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)
operator & (or "|") and operande
Fab Miredino
Greenhorn
Posts: 3
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
public class TestOperator { public static void main (String [] args){ int b = (2 & 1); System.out.println(b); //0 int c = (2 & 3); System.out.println(c); // 2 } }
Why the result of b is 0 and the result of c is 2 ?
What is the underlying principle ?
Piyush Joshi
Ranch Hand
Posts: 207
I like...
posted 12 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Fab,
Welcome to JavaRanch.
These are Integer Bitwise Operators: & , ^, |
Read
http://en.wikipedia.org/wiki/Bitwise_operation#AND
to know how they work.
BTW they are not a part of OCPJP6 exam objectives.
Piyush
Fab Miredino
Greenhorn
Posts: 3
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Piyush.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
String to math operation
char problem
postfix question
Result of the Code
Sorting an array using loops
More...