Skip to content

Commit c63bb2b

Browse files
committed
added new features
1 parent 15d5522 commit c63bb2b

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

β€ŽCalculator.javaβ€Ž renamed to β€ŽApplications/Calculator.javaβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package Applications;
12
import java.util.Scanner;
23

34
import javax.sql.rowset.spi.SyncResolver;

β€ŽApplications/OddEven.javaβ€Ž

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package Applications;
2+
import java.util.Scanner;
3+
4+
class application{
5+
public static String oddeven(int b){
6+
if(b%2==0){
7+
return("The value is Even");
8+
}
9+
else{
10+
return ("The value is Odd");
11+
}
12+
13+
14+
}
15+
16+
17+
public static void main(String args[]){
18+
Scanner input=new Scanner(System.in);
19+
System.out.println("Enter the value:");
20+
int a=input.nextInt();
21+
System.out.println("You entered value is:"+a);
22+
23+
for(int i=0;i<=a;i++){
24+
System.out.println(i);
25+
}
26+
if(a==10){
27+
for(int j=1;j<=5;j++){
28+
System.out.println("Java darling !!");
29+
}}
30+
else{
31+
System.out.println("Hi Java");
32+
}
33+
System.out.println("Type value to check odd or even:");
34+
int c=input.nextInt();
35+
System.out.println(oddeven(c));
36+
37+
String[] array=new String[5];
38+
39+
}
40+
}
41+
42+
43+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import java.util.*;
2+
3+
class JavaException{
4+
5+
6+
public static void main(String args[]){
7+
Scanner input= new Scanner(System.in);
8+
System.out.println("Enter the value:");
9+
int val=input.nextInt();
10+
try{
11+
int data=val/0;
12+
}
13+
catch(ArithmeticException a){
14+
System.out.println(a);
15+
}
16+
System.out.println("Hello Exeption Handling");
17+
}
18+
}

β€ŽSimple.classβ€Ž

-420 Bytes
Binary file not shown.

0 commit comments

Comments
Β (0)