Define an array of refernces from a class
Hi,
I'm not sure at all how to start this class of?
I've been told I need to declare and instantiate the array as a static member at the class level.
I have no idea what this means?
Also I need to print some results that I have created in this class.
What is the syntax for this:
I'm trying to use:
Code java:
System.out.print("Name:"+ (i+1) + getName());
but I'm getting a create method error.
The method is created though in the superclass.
How do I refer to the result from the superclass?
Thanks in advance for your help.
Re: Define an array of refernces from a class
Where are you stuck? Do you know how to declare variables? How to declare arrays? How to declare static variables? If not you can find most of this information in the Java Variables Tutorial
Re: Define an array of refernces from a class
Quote:
but I'm getting a create method error.
The method is created though in the superclass.
How do I refer to the result from the superclass?
Show where the method is declared in the super class. Looking as if the method was declared more like a variable according to your rewording of the error message.
To increase your chances of useful suggestions, post all related code and word for word error messages with your questions.
Re: Define an array of refernces from a class
No need to show all of the code. Just copy paste the footprint of the method. One line.
Re: Define an array of refernces from a class
I've managed to figure this out but I can't post the code because its for an assignment.
Thanks for your help.