Using args[0] in method main

Help with this code pls, i am newbie...

publicclass PhoneBook

{

publicstaticvoid main(String args[])

{

Person Caio =new Person("Caio Gregorio","Via della Malora","334536536");

Person Lupo =new Person("Lupo Alberto","Un posto al sole","85927");

Person Tizio =new Person("Tizio Sempronio","Ignoto","33333333");

int x;

if (args[0]=="caio") Caio.printPerson();

elseif (args[0]=="lupo") Lupo.printPerson();

elseif (args[0]=="tizio") Tizio.printPerson();

else System.out.println("Unknown person");

}

}

When i compile it, my compiler says there are no errors,but if i run (for example) "java PhoneBook caio" in dos prompt i get the output "Unknown person" instead of "Caio Gregorio.............536".

Can someone please tell me where is the problem? (I get the same output even if i type lupo or tizio as the arg of my method....)

[1859 byte] By [m0linasa] at [2007-10-3 4:53:12]
# 1
Use equals instead of ==Kaj
kajbja at 2007-7-14 22:58:03 > top of Java-index,Java Essentials,New To Java...
# 2
or intern the Strings
kilyasa at 2007-7-14 22:58:03 > top of Java-index,Java Essentials,New To Java...
# 3

> Can someone please tell me where is the problem?

Well it's too bad people did tell you. I for one would not care to, since you can't be bothered to thank people for answering you in your other thread the other day.

http://forum.java.sun.com/thread.jspa?threadID=767691

(ignoring the off-topic banter after the answers were given)

warnerjaa at 2007-7-14 22:58:03 > top of Java-index,Java Essentials,New To Java...
# 4
Thanks you all for asking, i'll try using equals!warnerja i can't understand what you wrote....maybe there is a problem with me?
m0linasa at 2007-7-14 22:58:03 > top of Java-index,Java Essentials,New To Java...
# 5
> warnerja i can't understand what you wrote....maybe> there is a problem with me?Evidently. You're an ingrate.
dcmintera at 2007-7-14 22:58:03 > top of Java-index,Java Essentials,New To Java...