-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
934ab25
commit 30d3ead
Showing
20 changed files
with
120 additions
and
37 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,16 @@ | ||
class RunLoop1 extends Thread{ | ||
@Override | ||
public void run(){ | ||
for (int i = 0; i <= 5; i++) { | ||
System.out.println(i); | ||
} | ||
} | ||
} | ||
|
||
class RunLoop2 extends Thread{ | ||
@Override | ||
public void run(){ | ||
for (int i = 10; i < 15; i++) { | ||
System.out.println(i); | ||
} | ||
} | ||
} | ||
public class Demo { | ||
|
||
public static void main(String[] args) { | ||
int l, b, ar, per; | ||
|
||
l = 25; | ||
b = 30; | ||
ar = l * b; | ||
|
||
per = 2 * (l + b); | ||
|
||
public class Demo{ | ||
public static void main(String[] args) { | ||
RunLoop1 st1 = new RunLoop1(); | ||
RunLoop2 st2 = new RunLoop2(); | ||
st1.start(); | ||
st2.start(); | ||
System.out.println("Area of rectange: " + ar); | ||
System.out.println("Perimeter of rectange: " + per); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
|
||
import java.util.Vector; | ||
|
||
|
||
|
||
|
||
public class PracticeArrays { | ||
|
||
public static void main(String[] args) { | ||
try { | ||
int num = 2/0; | ||
System.out.println(num); | ||
} catch (ArithmeticException e) { | ||
System.out.println("Something went wrong: " + e.getMessage()); | ||
}finally{ | ||
System.out.println("Using exception here"); | ||
} | ||
Vector<Integer> vec = new Vector<>(); | ||
vec.add(2); | ||
vec.add(2); | ||
vec.add(2); | ||
System.out.println(vec); | ||
vec.set(2,1); | ||
System.out.println(vec); | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
|
||
|
||
public class Rect { | ||
|
||
public static void main(String[] args) { | ||
int l, b, ar, per; | ||
l = Integer.parseInt("20"); | ||
b = Integer.parseInt("30"); | ||
|
||
ar = l * b; | ||
per = 2 * (l + b); | ||
System.out.println("Area of rectange: " + ar); | ||
System.out.println("Perimeter of rectange: " + per); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import java.util.Scanner; | ||
class Test { | ||
public static void main(String[] args) { | ||
Scanner sc = new Scanner(System.in); | ||
System.out.print("Enter a number: "); | ||
int num = sc.nextInt(); | ||
int reverse = 0; | ||
while (num != 0) { | ||
reverse = reverse * 10 + num % 10; | ||
num /= 10; | ||
} | ||
System.out.println("The reversed number is: " + reverse); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<h5 id="twentyninth">29. Design a login page using JSP and Servlet.</h5> | ||
<div class="container"> | ||
<pre class="box"> | ||
<code class="java"> | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
<%@ page import="java.util.Date, java.text.SimpleDateFormat" %> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Login Page</title> | ||
<link rel="stylesheet" href="./css/style.css" type="text/css" /> | ||
</head> | ||
<body> | ||
<div class="login-container"> | ||
<form action="#" method="POST" class="login-form"> | ||
<h1 class="title">Login</h1> | ||
|
||
<div class="input-group"> | ||
<label for="email">Email</label> | ||
<input | ||
type="email" | ||
id="email" | ||
name="email" | ||
placeholder="Enter your email" | ||
required | ||
/> | ||
</div> | ||
|
||
<div class="input-group"> | ||
<label for="password">Password</label> | ||
<input | ||
type="password" | ||
id="password" | ||
name="password" | ||
placeholder="Enter your password" | ||
required | ||
/> | ||
</div> | ||
|
||
<button type="submit" class="login-btn">Login</button> | ||
|
||
<p class="register-link"> | ||
Don't have an account? <a href="#">Register here</a> | ||
</p> | ||
</form> | ||
</div> | ||
<div class="footer"> | ||
<hr /> | ||
<%-- Get current year --%> | ||
<% | ||
Date currentDate = new Date(); | ||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); | ||
String currentYear = sdf.format(currentDate); | ||
%> | ||
<p>© <%= currentYear %> All Rights Reserved.</p> | ||
</div> | ||
</body> | ||
</html> | ||
</code> | ||
|
||
</pre> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
h1{ | ||
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; | ||
} |