O
Omer
Hi All,
In my class I'd like to have 2 constructors with different signature
(arguments). I'd like one to call the other, something like the
following example.
//------------------------------------------------------------------
import java.awt.Point;
public class MyClass {
Point pt;
//------------------------------------------------------------------
public MyClass (int x, int y) {
pt = new Point(x, y);
}
//------------------------------------------------------------------
public MyClass () {
MyClass (0, 0);// <=== error: cannot resolve symbol. :-(
}
//------------------------------------------------------------------
}
//------------------------------------------------------------------
This code fails on "cannot resolve symbol." on the marked line.
Any suggestion?
TIA,
Omer.
In my class I'd like to have 2 constructors with different signature
(arguments). I'd like one to call the other, something like the
following example.
//------------------------------------------------------------------
import java.awt.Point;
public class MyClass {
Point pt;
//------------------------------------------------------------------
public MyClass (int x, int y) {
pt = new Point(x, y);
}
//------------------------------------------------------------------
public MyClass () {
MyClass (0, 0);// <=== error: cannot resolve symbol. :-(
}
//------------------------------------------------------------------
}
//------------------------------------------------------------------
This code fails on "cannot resolve symbol." on the marked line.
Any suggestion?
TIA,
Omer.