diff --git a/praticejava/Animal.class b/praticejava/Animal.class index 749c150..16de6c7 100644 Binary files a/praticejava/Animal.class and b/praticejava/Animal.class differ diff --git a/praticejava/Calc.class b/praticejava/Calc.class index 6aa5ec8..8717a2a 100644 Binary files a/praticejava/Calc.class and b/praticejava/Calc.class differ diff --git a/praticejava/CheckEven.class b/praticejava/CheckEven.class new file mode 100644 index 0000000..033b595 Binary files /dev/null and b/praticejava/CheckEven.class differ diff --git a/praticejava/Demo.class b/praticejava/Demo.class index 9aa79cd..a3537a6 100644 Binary files a/praticejava/Demo.class and b/praticejava/Demo.class differ diff --git a/praticejava/Demo.java b/praticejava/Demo.java index 680394f..e5c29be 100644 --- a/praticejava/Demo.java +++ b/praticejava/Demo.java @@ -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); } } diff --git a/praticejava/Dog.class b/praticejava/Dog.class index a5a8a5e..6c13838 100644 Binary files a/praticejava/Dog.class and b/praticejava/Dog.class differ diff --git a/praticejava/Flipkart.class b/praticejava/Flipkart.class new file mode 100644 index 0000000..eba9720 Binary files /dev/null and b/praticejava/Flipkart.class differ diff --git a/praticejava/Message.java b/praticejava/Message.java deleted file mode 100644 index 0eafb2d..0000000 --- a/praticejava/Message.java +++ /dev/null @@ -1,7 +0,0 @@ -public class Message { - public static void main(String[] args) { - Animal ani = new Animal(); - Dog doggy = new Dog(); - doggy.eat(); - } -} diff --git a/praticejava/PracticeArrays.class b/praticejava/PracticeArrays.class index 805c3e8..d2df4de 100644 Binary files a/praticejava/PracticeArrays.class and b/praticejava/PracticeArrays.class differ diff --git a/praticejava/PracticeArrays.java b/praticejava/PracticeArrays.java index 03c7419..fc46288 100644 --- a/praticejava/PracticeArrays.java +++ b/praticejava/PracticeArrays.java @@ -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 vec = new Vector<>(); + vec.add(2); + vec.add(2); + vec.add(2); + System.out.println(vec); + vec.set(2,1); + System.out.println(vec); } } diff --git a/praticejava/Rect.class b/praticejava/Rect.class new file mode 100644 index 0000000..55e443e Binary files /dev/null and b/praticejava/Rect.class differ diff --git a/praticejava/Rect.java b/praticejava/Rect.java new file mode 100644 index 0000000..dab6e0d --- /dev/null +++ b/praticejava/Rect.java @@ -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); + } +} diff --git a/praticejava/SayHello.class b/praticejava/SayHello.class index d3a2cec..ba7ebe4 100644 Binary files a/praticejava/SayHello.class and b/praticejava/SayHello.class differ diff --git a/praticejava/Student.class b/praticejava/Student.class index e23bba3..790ea5f 100644 Binary files a/praticejava/Student.class and b/praticejava/Student.class differ diff --git a/praticejava/Test.class b/praticejava/Test.class new file mode 100644 index 0000000..abd42d6 Binary files /dev/null and b/praticejava/Test.class differ diff --git a/praticejava/Test.java b/praticejava/Test.java new file mode 100644 index 0000000..3cb43c7 --- /dev/null +++ b/praticejava/Test.java @@ -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); + } +} \ No newline at end of file diff --git a/praticejava/ThreadOne.class b/praticejava/ThreadOne.class index 49da7b5..b5d1ee9 100644 Binary files a/praticejava/ThreadOne.class and b/praticejava/ThreadOne.class differ diff --git a/praticejava/ThreadTwo.class b/praticejava/ThreadTwo.class index f49f9be..3c7f3cb 100644 Binary files a/praticejava/ThreadTwo.class and b/praticejava/ThreadTwo.class differ diff --git a/praticejava/index.jsp b/praticejava/index.jsp new file mode 100644 index 0000000..4a18f63 --- /dev/null +++ b/praticejava/index.jsp @@ -0,0 +1,64 @@ +
29. Design a login page using JSP and Servlet.
+
+
+            
+              <%@ 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>
+            
+            
+              
+
\ No newline at end of file diff --git a/praticejava/test.css b/praticejava/test.css new file mode 100644 index 0000000..94343cc --- /dev/null +++ b/praticejava/test.css @@ -0,0 +1,3 @@ +h1{ + font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; +} \ No newline at end of file