-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy path2.4.5 Hello! (Part 2)
44 lines (36 loc) · 928 Bytes
/
2.4.5 Hello! (Part 2)
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
public class Hello {
private String name;
public Hello (String yourName){
name = yourName;
}
public void english(){
System.out.print("Hello ");
System.out.print(name);
System.out.println("!");
}
public void spanish(){
System.out.print("Hola ");
System.out.print(name);
System.out.println("!");
}
public void french(){
System.out.print("Bonjour ");
System.out.print(name);
System.out.println("!");
}
public void german(){
System.out.print("Hallo ");
System.out.print(name);
System.out.println("!");
}
public void russian(){
System.out.print("Privet ");
System.out.print(name);
System.out.println("!");
}
public void chinese(){
System.out.print("Ni hao ");
System.out.print(name);
System.out.println("!");
}
}