global variable

That is initializing the array

int[] arr;

is declaring it.

Also, this works

Object[] arr = {new String(“HI”),new Integer(“HI”)};

Renoria was at least right on that part (though he did declare a new array)

Edit: I take that second part back, I forgot about that annoying caveat that you can only do that when declaring and initializing on the same line.

OH well. but why is it an array??

Ok, you are right. I just meant providing inital values.

Actually I really didn’t know that this could work in any circumstance. You live, you learn :wink:

Have you read my post? It was an example for having more than one enemy in your game.

OH ok so it owuld work fine wiht jsut one String going through?

Sure. Just create one Enemy with new Enemy(“Name”). The only thing you have to understand is, that member variables of a class keep their value for the specific instance you create with new and if you change the value of a member variable, it is changed in scope of that instance. That is the difference to a global variable, which would change for the whole program.

For more information, see http://java.sun.com/docs/books/tutorial/java/concepts/index.html