This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
For the == operator to work ... I think the two objects compared must be of same type or must belong to the same hierarchy .
Here your two object reference variables are vastly different and neither reference type extends the other , so theres no way both reference variables can refer to same object(== tests if they refer to same object). Hence == cannot be applied.
Kevin Liu
Greenhorn
Joined: Mar 17, 2007
Posts: 10
posted
0
File---> Typ.java
code:-
public class Typ { int i=0;//static int i = 0; public static void main(String args[]) { System.out.println(i); //or System.out.println(new Typ().i); } }