Its like a hideous car accident you see on the way home from work, its horrible and you feel sorry for the people involved but you can't help but stare. - sorry, wasn't adding anything

You can't set C inside the function, it doesn't exist, you'd only be setting the local scope pointer in the function. To do what you're aiming for you'd have declared the array, pass that in and set the contents.

Sigh, I pointed it out in the very first post of this thread, yet it seems to have been forgotten. Anyway, C is a reference to null. When you pass that to the function it will NOT be able to change your reference. It can manipulate the OBJECT which your reference points to, for example it could put values into an array. However it cannot put values into null.

And while the method could create a new array and assigning a reference to it and put things into that, C still points to null.

the assignment to 'closed' does absolutely nothing? 'closed' is passed BY VALUE, like everything in Java. All that code does is change the value of the LOCAL variable 'closed', the actual variable that you passed when you called the method remains unaffected.

has an infinite while-loop because 'exit' = false and it can never change. Since it is a local variable it can't be touched outside that thread and nothing in that thread changes it after it has been initialized.

I don't intend to sound mean, but your code shows a basic lack of understanding of the Java language in general. You should probably work on that a bit before you tackle writing a game. Game programming is usually not beginner-level coding, unless you start with some very simple games, like Tic-Tac-Toe.Have you gone through the Java tutorials a java.sun.com? They are a good place to get familiar with the language.

You should probably post in Newless Clubies unless you are really having a problem with networking as opposed to just general coding issues.

Sigh, I pointed it out in the very first post of this thread, yet it seems to have been forgotten. Anyway, C is a reference to null. When you pass that to the function it will NOT be able to change your reference. It can manipulate the OBJECT which your reference points to, for example it could put values into an array. However it cannot put values into null.

And while the method could create a new array and assigning a reference to it and put things into that, C still points to null.

You need to get hold of some more books.

incorect whith arays becouse any aray can be refrenced from any class in the same JVM becous they are stored in the stack(well this is my gues but it works anyway )my exampl is

1 2 3 4 5

char[] c = newchar[20];

Strings = "s";s.getChars(0 , 20 , c , 0);

that should work s.getChars(0 , 20 , c , 0); is a void not an char[]you shoould read the java docs

Of course you can manipulate an array from a method by passing a reference to that method, that's completely basic! Arrays can be referenced in exactly the same way as any other object can. And objects are stored on the heap, whereas references as such may be stored on the stack, though this is quite irrelevant to the discussion.

Allow me to reiterate the point with my previous post, namely that a null reference cannot be changed from inside a method to which it is passed. This is because passing a reference actually creates a copy of that reference, thus you cannot manipulate the original reference.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org