Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Other Sciences
Programming and Computer Science
A little clique "game" in Java - Clique Problem
Reply to thread
Message
[QUOTE="Jeronimus, post: 5469636, member: 439773"] Thanks. However, more accurate would have been "Looks good, it works". I am just a hobby programmer, not coding much really and i made a terrible mistake in this code. It only works because of "luck" in a sense. I used if (str==("<some String>")){ to compare the strings but the proper way is if (str.equals("<some String")){ The only reason it worked, is because the JVM is smart enough to use the same reference for equal strings. But that isn't always the case, so it might break for other programs. So i was comparing the references rather than the strings themselves. Here is the fixed version [URL]http://pastebin.com/zpReBGK0[/URL] also cleaned of some obsolete System.out.println calls i used for debugging and forgot to remove. It's not really absolutely necessary to use the new version. The old works i guess because i got lucky, but i had to set this straight for anyone who actually wants to use part of the code for their own projects. [/QUOTE]
Insert quotes…
Post reply
Forums
Other Sciences
Programming and Computer Science
A little clique "game" in Java - Clique Problem
Back
Top