forked from natural/java2python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCtor0.java
More file actions
40 lines (25 loc) · 744 Bytes
/
Ctor0.java
File metadata and controls
40 lines (25 loc) · 744 Bytes
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
class Ctor0 {
public int m_foo;
public int m_bar;
public Ctor0() {
this(/* foo */ 0, /* bar */ 0);
}
public Ctor0(int p_foo) {
this(p_foo, 0);
}
public Ctor0(int p_foo, int p_bar) {
m_foo = p_foo;
m_bar = p_bar;
}
public static void main(String[] args) {
Ctor0 a = new Ctor0();
System.out.println(a.m_foo);
System.out.println(a.m_bar);
Ctor0 b = new Ctor0(1);
System.out.println(b.m_foo);
System.out.println(b.m_bar);
Ctor0 c = new Ctor0(2, 3);
System.out.println(c.m_foo);
System.out.println(c.m_bar);
}
}