Glad you got it working.
Type: Posts; User: Norm
Glad you got it working.
Did you try changing the source and compiling it? What did the compiler say?
Put the keyword static first thing on the line.
??? I just said the name of the variable that should be made static: out
See the tutorial about static: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html
Make out a static variable.
Is this the one?
Change printf() to print()
Or read the API doc for the printf() method to see how to use it.
If you have questions about the API doc, copy the doc here and ask your questions...
Too much code in static methods is causing that error.
Did you Google that error. It is very common.
For now make out a static variable.
It has a problem and needs to be changed. That is what all the posts since then have been about. You were supposed to change the code.
Move the definition for the variable: out outside of the...
Please post the whole class where that statement is.
The error message says that statement is in the wrong place in the code.
Do you know how to define a variable?
You need to copy the full text of the error message and paste it here. I can't see your code from here.
Please read post#19
Where is out defined?
class A_Class {
int classVar; // define at class level; in Scope for all methods
void meth1() {
int aVar; // define aVar; in...
If it is defined inside of a method, then it is OUT OF SCOPE in any other method. Move its definition out of the method to the class level so all methods can see it.
A variable can be defined in...
Where is the variable: out defined? Is it in scope where the error happens?
That's a compiler error which means your code is not ready for execution. You need to find out what symbol is not found. Try using the javac command to compile the file. It gives nice error...
What symbol is not found?
Try it and see what happens. Print the contents of the array using:
System.out.println("an ID "+ java.util.Arrays.toString(theArrayNameHere));
Recommend doing it for 25 elements vs 2500 for...
Use a for loop containing an assignment statement.