package other;
public class Other
{
public static
String hello = "Hello";
}
package testPackage;
import current.other.Other.*;
class
Test {
public static void main(String[] args)
{
String hello = "Hello", lo = "lo";
System.out.println((Other.hello == hello) + "");
System.out.println((other.Other.hello == hello) + "");
System.out.println((hello == ("Hel" + "lo")) + "");
System.out.println((hello == ("Hel" + lo)) + "");
}
}
the answer given is true true true false true.
I don't understand this answer. Cananyone expalin the rules behind how to identify the answers.
Q.2)
Can anyone can give me the link where sources of different types of events ? MenuComponent class and its subclasses can generate which type of events?
Thanks in advance.
Q.3)
The following code snippet will not compile
int i = 10;
System.out.println(i<20? out1() : out2());
Assume that out1 and out2 have method signature:
public void out1();
and
public void out2();
the answer given is true.
I don't understand this answer. can anyone explain this in detail?