This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Bitwise Operators Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Bitwise Operators " Watch "Bitwise Operators " New topic
Author

Bitwise Operators

Anupama Kota
Greenhorn

Joined: May 21, 2001
Posts: 22
Hi
char v1 = ')';//41
byte v2 = 13;

~v1 = -42;
v1&v2 = 9;
v1|v2 =45;

I know the process that the value is coveted to binary and then operate both regarding to the operator.
But in the exam it is time taken process.That we have to rember all Ascii values.May be some times it goes worng in recollecting.
Is there any other simple way like 12>>2 is 12 / (2(power)2)??
Haining Mu
Ranch Hand

Joined: Jun 01, 2001
Posts: 51
really? are we require to remember ASCII?
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4446
    
    5

No, you are not expected to remember the ASCII code table.
It helps to know how to convert numbers from one base to another though. For bitwise operation questions, it's best to know the binary representations of 0x00 to 0x0F, how to get the one's complement and two's complement, how to convert from decimal to binary and vice versa.
Junilu


Junilu - [How to Ask Questions] [How to Answer Questions]
Anupama Kota
Greenhorn

Joined: May 21, 2001
Posts: 22
Hi
Junilu
Yes,I understand how to convert both binary to hex,oct and vice versa,1's and 2's complement.But if this type of question come in Exam then what we have to do.
We have to know na about ")" that character is represented as decimal 41 .How we know this??
If mine thinking is wrong pl correct me.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4446
    
    5

I think it's highly unlikely that Sun will give any questions that require you to memorize the ASCII code table. The questions I got that involved bitwise operators were pretty straightforward. Don't worry about it.
Junilu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bitwise Operators
 
Similar Threads
arrayOutOfIndex
Few Puzzles
Need Help with a SQL Insert Statement
Help please
Guarenteeing G.C part