The following code appears in the main method of a properly defined
Java class. assume that all necessary imports have been called.
There are also local, overloaded methods to replace System.out.print()
and System.out.println() called SOP() and SOPL() respecitvely.
Spaces have replaced the tabs for readibility - Google's tabs are to big.
String a="Hello";
String b="Hello";
if(a.equals(b))
SOPL(1);
if(a==b)
SOPL(2);
b="Hello World".substring(0,5);
if(a.equals(b))
SOPL(3);
if(a==b)
SOPL(4);
if(b.equals("Hello"))
SOPL(5);
if(b=="Hello")
SOPL(6);
if(a.equals("Hello"))
SOPL(7);
if(b=="Hello")
SOPL(8);
It seems odd, I know. You'll probably think that I am asking a trick
question. Do not worry, I am. An explination is available on page
194 of the Big Java book. have fun!
-Jake
--
<font size = "4", color = "red"><i>CanadianGreenBeret</i></font>