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

Appearance settings

Latest commit

 

History

History
History
43 lines (36 loc) · 679 Bytes

File metadata and controls

43 lines (36 loc) · 679 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
public class TestOverLoad {
public static void main(String[] args) {
Person p = new Person();
Person p1 = new Person(400);
Person p2 = new Person(2, 500);
p.info();
p.info("ok");
}
}
class Person {
Person() {
id = 0;
age = 20;
}
Person(int _id) {
id = _id;
age = 23;
}
Person(int _id, int _age) {
id = _id;
age = _age;
}
//³ÉÔ±±äÁ¿¶¨Òå
private int id;
private int age = 20;
//·½·¨¶¨Òå
public int getAge() {return age;}
public void setAge(int i) {age = i;}
public int getId() {return id;}
void info() {
System.out.println("my id is : " + id);
}
void info(String t) {
System.out.println(t + " id " + id);
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.