Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "operators" Watch "operators" New topic
Author

operators

Shubh Bhat
Ranch Hand

Joined: Sep 08, 2002
Posts: 32
q1. can anyone give me a complete and good source on operators?
q2.

public class TestByte
{
public static void main(String[] arg) {
int i=1, j=2;
byte b = 127;
short k = 1;
short s1 = (short)i + (short)j; //1
short s2 = (short)(i + j);
i = (short)j + b>>2;
i = (short)i + (short)i; //2

}
}
why should 1 complain and not 2?


~-<br />Doing my best this time and everytime.<br />-- Me
Shubh Bhat
Ranch Hand

Joined: Sep 08, 2002
Posts: 32
got the answer!
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
But do you have the correct answer?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: operators
 
Similar Threads
Boxing
Is assignment precedence(=) higher than postfix unary assignment(var++)
"conversion" of primitive types
Binary in Java
Majji Mock Exam # 1