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....)

