Skip to content

Commit

Permalink
updated the other questions
Browse files Browse the repository at this point in the history
  • Loading branch information
icodervivek committed Jan 31, 2025
1 parent 934ab25 commit 30d3ead
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 37 deletions.
Binary file modified praticejava/Animal.class
Binary file not shown.
Binary file modified praticejava/Calc.class
Binary file not shown.
Binary file added praticejava/CheckEven.class
Binary file not shown.
Binary file modified praticejava/Demo.class
Binary file not shown.
33 changes: 11 additions & 22 deletions praticejava/Demo.java
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 modified praticejava/Dog.class
Binary file not shown.
Binary file added praticejava/Flipkart.class
Binary file not shown.
7 changes: 0 additions & 7 deletions praticejava/Message.java

This file was deleted.

Binary file modified praticejava/PracticeArrays.class
Binary file not shown.
20 changes: 12 additions & 8 deletions praticejava/PracticeArrays.java
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 added praticejava/Rect.class
Binary file not shown.
16 changes: 16 additions & 0 deletions praticejava/Rect.java
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 modified praticejava/SayHello.class
Binary file not shown.
Binary file modified praticejava/Student.class
Binary file not shown.
Binary file added praticejava/Test.class
Binary file not shown.
14 changes: 14 additions & 0 deletions praticejava/Test.java
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 modified praticejava/ThreadOne.class
Binary file not shown.
Binary file modified praticejava/ThreadTwo.class
Binary file not shown.
64 changes: 64 additions & 0 deletions praticejava/index.jsp
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">
&lt;%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%&gt;
&lt;%@ page import="java.util.Date, java.text.SimpleDateFormat" %&gt;

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset="UTF-8" /&gt;
&lt;title&gt;Login Page&lt;/title&gt;
&lt;link rel="stylesheet" href="./css/style.css" type="text/css" /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="login-container"&gt;
&lt;form action="#" method="POST" class="login-form"&gt;
&lt;h1 class="title"&gt;Login&lt;/h1&gt;

&lt;div class="input-group"&gt;
&lt;label for="email"&gt;Email&lt;/label&gt;
&lt;input
type="email"
id="email"
name="email"
placeholder="Enter your email"
required
/&gt;
&lt;/div&gt;

&lt;div class="input-group"&gt;
&lt;label for="password"&gt;Password&lt;/label&gt;
&lt;input
type="password"
id="password"
name="password"
placeholder="Enter your password"
required
/&gt;
&lt;/div&gt;

&lt;button type="submit" class="login-btn"&gt;Login&lt;/button&gt;

&lt;p class="register-link"&gt;
Don&#39;t have an account? &lt;a href="#"&gt;Register here&lt;/a&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;div class="footer"&gt;
&lt;hr /&gt;
&lt;%-- Get current year --%&gt;
&lt;%
Date currentDate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
String currentYear = sdf.format(currentDate);
%&gt;
&lt;p&gt;© &lt;%= currentYear %&gt; All Rights Reserved.&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code>

</pre>
</div>
3 changes: 3 additions & 0 deletions praticejava/test.css
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;
}

0 comments on commit 30d3ead

Please sign in to comment.