J2K: replace overloads with optional parameters not only for constructors but for methods too
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
class A {
|
||||
private String s = "";
|
||||
private int x = 0;
|
||||
|
||||
public A() {
|
||||
}
|
||||
|
||||
public A(int p, String s){
|
||||
this(p, s, 1);
|
||||
}
|
||||
|
||||
public A(int p, String s, int x) {
|
||||
this();
|
||||
this.s = s;
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user