Jump to content

  • Log In with Google      Sign In   
  • Create Account

Dennieh

Member Since 01 Jun 2012
Offline Last Active Jun 30 2014 12:03 PM

#4987339 Why won't it go to the method?

Posted by Dennieh on 06 October 2012 - 01:31 AM

Hi!

I haven't tried running your code, but one pretty obvious problem is using the equals operator (==) for comparing strings. This doesn't quite work as you'd expect in Java. What's happening is that you are comparing the memory locations of these strings, not the actual content. Which probably isn't what you intended. Instead, try using String's equals function, like so:

if (command.equals("g")){
    getNames();
}
if (command.equals("a")){
    addToList();
}
if (command.equals("q")){
    isRunning = false;
    System.exit(0);
}

Hope that helps you along!


#4945413 Advanced Books on Java and PHP

Posted by Dennieh on 01 June 2012 - 02:27 PM

Hi!

I don't know the first thing about PHP, but I do know Java. If you really want to know the language, I'd suggest going for the official Oracle Java certification. The first level (certified Java programmer) requires you to know a lot of the ins and outs of the language itself. I studied for this exam by reading the 'SCJP Sun Certified Programmer for Java 6 Study Guide', which is an excellent reference by itself. If you've passed this exam you can also go for other levels that focus on a specific parts of Java. For instance, I believe there's also a J2EE exam.

Anyway, I got the chance to do this at work, and I really loved it. I used to think I knew Java pretty well, but after getting the Java Programmer and Java Developer certificates, I pretty much reached new level of understanding. My boss payed for the books and the exams, which made it a pretty sweet deal Posted Image

If you get a chance to do this, I suggest you take it! Preparing for these exams will take some time, but I think it is well worth it. It was for me anyway!

Cheers!
Dennis


PARTNERS