I don't know why you see that error, but you have to fully qualify Vector or import it. Otherwise, you will see an error complaining about not understanding vector. Use: import java.util.Vector; on the top line and see if that helps. Other points, they're member variables, not globals. Java does not permit global variables. Member variables can, of course, be private. There's nothing illegal in how you've declared them. However, member variables should start with a lower-case letter. Code is communication. By following conventions you communicate effectively!
Joined: Jun 05, 2002
Thanks for the explanation of global variables. I screwed some definitions I tested your hint, but the compiler (newest version) still posts this error. It doesn`t depend only on the Vector-Class, the compiler is already complaining about the int with the same error. It also confuses me, because i didn`t do it different than all the times before. But see yourself You`ll find the files on: www.robertploch.de/files/Node.java www.robertploch.de/files/Edge.java www.robertploch.de/files/Graph.java [ May 19, 2003: Message edited by: Robert Ploch ]
If Nodes and Edges are class names then you cannot also use them as variable names. To avoid this be sure to follow the Java naming conventions of using lowercase for the initial letter of variable names, and uppercase for classes. hth, bear
i think i`ve got the error i programmed another, still unready file in the same directory as Graph.java javac compiled everything and only showed some errors in the unready file. now i`ve deleted the file and some errors in graph.java were born ok, now bugfixing thx for helping
thanks, but the variables do have the name`s: Edges & Nodes; the class`s names are Edge & Node, without 's', so it should`nt come to an error I strongly recommend that you follow Java Coding Conventions, -- it will make it easier for everyone (including you) to understand your code.