
what is the output of the following code?
public class objComp { Public static void main(String args[]) { Int result = 0; objComp oc= new objComp(); object o = oc; if( o==oc) result =1; if(o!=oc) result = result+10; if (o.equals(oc)) result=result+100; if (oc.equals(o)) result=result+1000; system.out.println(result); } }

There were so many errors. After removing all those error, we get the output: 1101
public class objComp {
public static void main(String args[]) {
int result = 0;
objComp oc= new objComp();
Object o = oc;
if( o==oc)
result =1;
if(o!=oc)
result = result+10;
if (o.equals(oc))
result=result+100;
if (oc.equals(o))
result=result+1000;
System.out.println(result);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.