Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

Java: Write a constructor with two arguments that can be used to set the instance variables of an object to any values.

OpenStudy (e.mccormick):

OK. Know the requirements for a constructor? It has the same name as the class but no return type. In the ( ) part of the definition, you define what arguments are going to be passed. Then in the body of that method you assign those passed arguments to the class variables. http://www.tutorialspoint.com/java/java_object_classes.htm

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!