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
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
valid use of compound assignment operator
kavundamani senthil
Greenhorn
Posts: 16
posted 16 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 16 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 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
ok got it ..thanks
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
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...