orry kaplan wrote:This is all of the code i have. And my error message i got is, " The method PrintDataArray(ArrayList<Data>) is undefined for the type PJ1"
orry kaplan wrote:This is all of the code i have. And my error message i got is, " The method PrintDataArray(ArrayList<Data>) is undefined for the type PJ1"
What is PJ1 ?
Thats just the name of the project. Do you know what the problem is and how i can possibly fix it?
Carey Brown wrote:2 things would help us help you: 1) show all of your code, 2) copy-n-paste error message(s) into your post.
" The method PrintDataArray(ArrayList<Data>) is undefined for the type PJ1"
Above statement itself is the problem definition. You need to define PrintDataArray() in your class. Besides, it would be very helpful if you share whole code here.
Here you are defining a method whose name is "method", not PrintDataArray.
You are expecting a parameter of type String[] instead of an ArrayList<Data>.
Your parameter name is PrintDataArray, which is ok unto itself, but should ideally be a different name than the name of the method.
Secondly you're attempting to define PrintDataArray inside the main() method. Java doesn't accept nested methods. You can have nested calls, but not nested definitions.
Edit: Define it after main()'s '}' and before the class' '}'.
Nit:
The Java convention is for method names to start with a lower case letter.
orry kaplan wrote:[
This is all of the code i have.
How can this be all the code?
There isn't even a class definition.
The code you posted doesn't compile. (Carry points out one reason why). Please post the entire code, exactly as you have written it, that compiles and runs, or produces an error. If the latter, please post the entire error message.
All things are lawful, but not all things are profitable.
Everyone is a villain in someone else's story. Especially this devious tiny ad: