Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f1f5dcf

Browse files
added essenfile initial files
0 parents commit f1f5dcf

File tree

8 files changed

+120
-0
lines changed

8 files changed

+120
-0
lines changed

‎Java Language/Helloworld.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class Helloworld{
2+
public static void main(String[] args){
3+
System.out.println("Hello World");
4+
}
5+
}

‎Java Language/if_else.class

540 Bytes
Binary file not shown.

‎Java Language/if_else.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
public class if_else{
2+
public static void main(String[] args) {
3+
// int a = 4, b = 3;
4+
// if (a<b) {
5+
// System.out.println("b is grater than a");
6+
7+
// }
8+
// else{
9+
// System.out.println("a is grater than b");
10+
// }
11+
int num = 3;
12+
if (num >5) {
13+
System.out.println("Good Morning");
14+
15+
}
16+
else if (num<5) {
17+
System.out.println("Good Afternoon");
18+
19+
}
20+
else{
21+
System.out.println("Good Night");
22+
}
23+
}
24+
}

‎Java Language/javaMATH.class

634 Bytes
Binary file not shown.

‎Java Language/javaMATH.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
public class javaMATH {
4+
public static void main(String[] args) {
5+
6+
System.out.println(Math.min(2, 4));
7+
System.out.println(Math.max(2, 4));
8+
System.out.println(Math.abs(-34));
9+
System.out.println(Math.sqrt(64));
10+
System.out.println(Math.random());
11+
System.out.println((int)(Math.random()*101)); /////random number between 0 to 100
12+
}
13+
14+
}

‎Java Language/variables.class

1.31 KB
Binary file not shown.

‎Java Language/variables.java

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
public class variables {
2+
public static void main(String[] args) {
3+
4+
String name = "Suman Paik";
5+
System.out.println(name);
6+
7+
int myInt = 37;
8+
System.out.println(myInt);
9+
10+
final int num = 34;
11+
// num = 23;
12+
System.out.println(num);
13+
// Here now you can't change the integer. the value of int is fix
14+
// variables.java:11: error: cannot assign a value to final variable num
15+
// num = 23;
16+
// ^
17+
// 1 error
18+
19+
20+
float myFloat = 23.34f;
21+
System.out.println(myFloat);
22+
float myFloat2 = 23e5f; // e3 is basically says the power of 10 that means e3 = 000 / 23e3 = 23000
23+
System.out.println(myFloat2);
24+
25+
char letter = 'd';
26+
System.out.println(letter);
27+
28+
boolean bool = true;
29+
System.out.println(bool);
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
// declared multiple variables
42+
43+
int a, b, c;
44+
a = b = c = 20;
45+
System.out.println(a+b+c);
46+
47+
int e = 1, f = 2, g = 3;
48+
System.out.println(e+f+g);
49+
50+
51+
52+
53+
54+
// byte 1 byte Stores whole numbers from -128 to 127
55+
// short 2 bytes Stores whole numbers from -32,768 to 32,767
56+
// int 4 bytes Stores whole numbers from -2,147,483,648 to 2,147,483,647
57+
// long 8 bytes Stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
58+
// float 4 bytes Stores fractional numbers. Sufficient for storing 6 to 7 decimal digits
59+
// double 8 bytes Stores fractional numbers. Sufficient for storing 15 decimal digits
60+
// boolean 1 bit Stores true or false values
61+
// char 2 bytes Stores a single character/letter or ASCII values
62+
63+
64+
65+
// Length in string
66+
67+
String str = " This is my JAVA practice.";
68+
System.out.println("The length is : " + str.length());
69+
System.out.println(str);
70+
71+
//Uppercase and lowercase convert
72+
73+
System.out.println(str.toUpperCase());
74+
System.out.println(str.toLowerCase());
75+
76+
}
77+
}

‎Linear Search/01LinearSearch.java

Whitespace-only changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /