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 da30b45

Browse files
files added
1 parent 17912bd commit da30b45

17 files changed

+133
-3
lines changed

‎Java Language/BasicJAVA/Helloworld.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package Basic;
1+
package BasicJAVA;
22
public class Helloworld{
33
public static void main(String[] args){
44
System.out.println("Hello World");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package Basic;
1+
package BasicJAVA;
22
0 1 2 3
33
// 4 5 6 7
44
// 8 9 10 11

‎Java Language/BasicJAVA/variables.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package Basic;
1+
package BasicJAVA;
22
public class variables {
33
public static void main(String[] args) {
44

Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
public class MethodOverloadingjavas {
2+
static int OverloadMethod(int a, int b){
3+
return a+b;
4+
}
5+
static float OverloadMethod(float a, float b){
6+
return a+b;
7+
8+
}
9+
10+
public static void main(String[] args) {
11+
int number1 = OverloadMethod(2,4);
12+
float number2 = OverloadMethod(2.5f,2.5f);
13+
System.out.println("Number 1 :" + number1);
14+
System.out.println("Number 2 :" + number2);
15+
}
16+
}
632 Bytes
Binary file not shown.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
public class RECURSION{
2+
static int sum(int a){
3+
if (a>0) {
4+
return a + sum(a-1);
5+
} else {
6+
return 0;
7+
}
8+
9+
10+
}
11+
public static void main(String[] args) {
12+
int result = sum(10);
13+
System.out.println(result);
14+
15+
int between = betweenSum(5, 10);
16+
System.out.println(between);
17+
}
18+
19+
20+
static int betweenSum(int start, int end){
21+
if (end > start) {
22+
return end + betweenSum(start, end - 1);
23+
24+
} else {
25+
return start;
26+
}
27+
}
28+
29+
}
30+
403 Bytes
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
public class ScopingINJava {
2+
3+
public static void main(String[] args) {
4+
5+
// Code here CANNOT use x
6+
7+
{ // This is a block
8+
9+
// Code here CANNOT use x
10+
11+
int a = 100;
12+
13+
// Code here CAN use x
14+
System.out.println(a);
15+
16+
} // The block ends here
17+
18+
// Code here CANNOT use x
19+
System.out.println(a); /// here a can't be accessable.
20+
}
21+
}
Binary file not shown.

0 commit comments

Comments
(0)

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