The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Re: Can't instantiate custom class

You have defined a constructor for Student that takes 2 parameters as an argument, if you wish to have an empty argument constructor - which is how you are trying to instantiate the class - explicitly define this constructor in your class, or use the two argument constructor.

Re: Can't instantiate custom class

Building on what Tsarin said above, when you instantiate your student object in your tester class, you need to give it arguments that match the types it it expecting. As Tsarin said, the student 2 argument constructor is expecting an INT for the first argument and an ARRAY of college courses as the second argument. You are attempting to pass a single college course as your second argument when it should be an array of college courses.