forked from vengateshm/Java-Coding-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTester.java
More file actions
62 lines (49 loc) · 1.34 KB
/
Tester.java
File metadata and controls
62 lines (49 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
public class Tester {
public static void main(String[] args) {
// printToConsoleWithoutSemiColon();
Tester tester = new Tester();
tester.test(10);
tester.test(10L);
tester.test((Integer) 10);
tester.test(10, 20);
tester.test((byte) 10);
tester.test((short) 10);
label:
for (int i = 0; i < 10; i++) {
if (i == 5) {
continue label;
}
System.out.println("" + i);
}
}
private static void printToConsoleWithoutSemiColon() {
// Print Hello world without semi-colon
if (System.out.printf("Hello World \n") == null) {
}
if (System.out.append("Hello World \n") == null) {
}
}
static boolean printString() {
System.out.println("Hola!");
return true;
}
static boolean printStatus = printString();
public void test(int i) {
System.out.println("int");
}
public void test(int... i) {
System.out.println("int...");
}
public void test(Integer i) {
System.out.println("Integer");
}
public void test(long i) {
System.out.println("long");
}
public void test(byte i) {
System.out.println("byte");
}
public void test(short i) {
System.out.println("short");
}
}