Hi,

Sorry to post this silly doubt here, but I need
experts' answers, and I dont find experts anywhere
other than here.

Accoring to Core Java and other books :

1. Unary operators have higher precedence that
multiplication/division operators.

2. Associativity of unary operator is from right to
left.

In light of this, can anybody explain the output of
the following program :

public static void main(String args[]){

     int a = 1;
     int b = 1;
     a = a++ * ++a;
     b = ++b * b++;
     System.out.println(a);
     System.out.println(b);
}

I am unable to figure out the reason for the output.

regards,
ram



__________________________________________________
Do You Yahoo!?
Talk to your friends online and get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to