I am passing the following to this code Howard James Mike. I am trying to read Howard but it is not working Why..
PART THAT DOES NOT WORK
if (myout == "Howard")
{
System.out.println("Hey Howardppp");
}
ENTIRE CODE
public class MyTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int howmany = args.length;
String[] myInfo = new String[howmany];
for (int a = 0 ; a < howmany; a++)
{
myInfo[a] = args[a]; //"Howard";
}
System.out.println(" how many args " + howmany);
for (int i = 0 ; i < howmany; i++)
{
System.out.println("Item" + i + " " + myInfo);
String myout;
myout = myInfo;
// this part does not work why
if (myout == "Howard")
{
System.out.println("Hey Howardppp");
}
//System.out.println("myout=" + myout);
}
System.out.println("end");
}
}
PART THAT DOES NOT WORK
if (myout == "Howard")
{
System.out.println("Hey Howardppp");
}
ENTIRE CODE
public class MyTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int howmany = args.length;
String[] myInfo = new String[howmany];
for (int a = 0 ; a < howmany; a++)
{
myInfo[a] = args[a]; //"Howard";
}
System.out.println(" how many args " + howmany);
for (int i = 0 ; i < howmany; i++)
{
System.out.println("Item" + i + " " + myInfo);
String myout;
myout = myInfo;
// this part does not work why
if (myout == "Howard")
{
System.out.println("Hey Howardppp");
}
//System.out.println("myout=" + myout);
}
System.out.println("end");
}
}