wood burning stoves 2.0*
The moose likes Java in General and the fly likes Operators Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Operators" Watch "Operators" New topic
Author

Operators

Samindra Mishra
Greenhorn

Joined: Aug 07, 2007
Posts: 1
public class Question41{
public static void main(String[] args){
Object[] obj = new Object[3];
for(int i=0;i<obj.length;i++)
obj[i] = (i%2==0)?new Object() bj[i-1];
if(obj[0] == obj[1] & (obj[1]=obj[2])!=null)
System.out.print("1 ");
if(obj[1] == obj[2] && (obj[2]=obj[0])!=null)
System.out.print("2 ");
if(obj[1] == obj[0] || (obj[0]=obj[1])==null)
System.out.print("3 ");
if(obj[2] == obj[0] | (obj[0]=obj[2])!=null)
System.out.print("4 ");
System.out.println((obj[0]==obj[1])+" "+(obj[1]==obj[2])+" "+(obj[0]==obj[2]));
}
}


Can any one help me with the output of the above coad
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2173
    
  47
Why not just run it and see what happens?

BTW: when posting code please use the code tags so the formatting is maintained and you don't get embedded smilies
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Operators
 
Similar Threads
Java ---== operato
How to convert java object in a request scope to javascript object???
3D array Figure
confusion in if condition
mock01a Q41