This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Bitwise Operators

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)??
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
really? are we require to remember ASCII?
 
Sheriff
Posts: 15045
252
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Anupama Kota
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 15045
252
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
This is my favorite tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!