Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

cannot resolve constructor

807606Feb 15 2007 — edited Feb 15 2007
I'm having a problem with some of my constructors in the class i am developing. The class has two constructors: A default no argument constructor, and a constructor that takes in 2 ints. The no-argument constructor works fine, but whenever i try to use the 2 arg constructor, i keep getting a cannot resolve symbol compile error.
I've tried using integer numbers and integer variables in the call, but neither work. I've tried chaning the argument types to see if a a different combination would work (ie. String, int), but that is also a no go. As far as I can tell, everything seems to be standard, and should work. here is a cut down version of the class i am using:
public class conTest {

	private int stuff1;
	private int stuff2;


	private void conTest(int s1, int s2) {
		stuff1 = s1;
		stuff2 = s2;
	}
}
and here is the test case i am using to try and get it to work:
public class test {

	public void main (String args[] ) {

		conTest tester = new conTest(10,10);

		tester.printStuff();

	}

}
Any input that could help figure out this problem would be greatly appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2007
Added on Feb 15 2007
3 comments
2,065 views