Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud
this week in the
Cloud/Virtualization
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Paul Clapham
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Saloon Keepers:
Tim Holloway
Carey Brown
Roland Mueller
Piet Souris
Bartenders:
Forum:
Programmer Certification (OCPJP)
valid use of compound assignment operator
kavundamani senthil
Greenhorn
Posts: 16
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi ppl,
is this a valid use of
java
assignment operator
y+=(y=1)
what is the value if it is so ?
regards,
Senthil
Gaurav Arora
Ranch Hand
Posts: 35
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Apparently it is valid (since it compiles) and the value is y + 1.
The right side is evaluated first so y becomes one because of (y=1) and then the old value of y is added to that 1 to output y + 1.
kavundamani senthil
Greenhorn
Posts: 16
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
ok got it ..thanks
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
assignment operators
Comparing chars at positions in an array
Problem when using ternary operatory in For Each loop
K&B Master Exam SCJP6 class mineral question: why is the answer 'null null'
Iterations - finding the same value for 2 variables
More...