forked from spring-projects/spring-integration-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nassier.java
96 lines (71 loc) · 2.01 KB
/
nassier.java
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
public class HelloWorld {
public static void main(String[] args){
System.out.println("Hello World");
float a=2.0f;
System.out.println(a);
if(true){
System.out.println("It's true");
}else{
System.out.println("Oopssiiee. It's false");
}
for(int i=0;i<10;i++){
System.out.println("It's" + i);
}
/*
try{
for(int i=0;i<1000;i++){
Thread.sleep(1000);
System.out.println(i);
}
}
catch(Exception e){
}*/
doSomething("Flyingg");
Father father = new Father();
father.setFirstName("Mark");
father.setLastName("Ang");
System.out.println(father.getFirstName());
System.out.println(father.getLastName());
Son son = new Son();
son.setFirstName("Allan");
son.setLastName("Ang");
System.out.println(son.getFirstName());
System.out.println(son.getLastName());
}
public static void doSomething(String action){
System.out.println(action);
}
}
class Man{
private String name;
private double height;
private double weight;
public String getName() {
return name; }
public void setName(String name) {
this.name = name; }
public double getHeight() {
return height; }
public void setHeight(double height) {
this.height = height; }
public double getWeight() {
return weight; }
public void setWeight(double weight) {
this.weight = weight; }}
class Father{
private String firstName;
protected String lastName;
public String getFirstName() {
return firstName; }
public void setFirstName(String firstName) {
this.firstName = firstName; }
public String getLastName() {
return lastName; }
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
class Son extends Father{
public String getFirstName() {
return "I have my own First Name"; }
}