File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes int x=3+ + + + 3; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "int x=3+ + + + 3;" Watch "int x=3+ + + + 3;" New topic
Author

int x=3+ + + + 3;

joshua antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 117


why does the above code compile?
what is the + + adding in between the two numbers.

Thanks in advance
Joshua
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
What about: int x = 3 + (+(+(+3))); ?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

You wont find something like that on the exam


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
joshua antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 117
You wont find something like that on the exam


Thank you,
I am relieved now.

Regards,
Joshua
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: int x=3+ + + + 3;
 
Similar Threads
who can get the simplest code?
++ operator
Dan's questions : static variable
simple code
if ((x == 1) or ( x==2))