aspose file tools*
The moose likes Beginning Java and the fly likes How the values are stored? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How the values are stored?" Watch "How the values are stored?" New topic
Author

How the values are stored?

dinesh Venkatesan
Ranch Hand

Joined: Oct 12, 2006
Posts: 134
Hi all,

This is a very basic question. Consider the following code snippet.

int a = 5;
int b = 1;

How the value 5 is stored inside memory. Since int are 32 bit values will it be stored like

0000 0000 0000 0000 0000 0000 0000 0101.
if i am correct about this, then while performing an operation like this,
int c = ~b;
will it reult in a value like this?
1111 1111 1111 1111 1111 1111 1111 1010.
Please clarify me.
Thanks in advance!
V.dinesh.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

Yes, and yes. Everything you've stated is correct.


[Jess in Action][AskingGoodQuestions]
dinesh Venkatesan
Ranch Hand

Joined: Oct 12, 2006
Posts: 134
Thank you.
dinesh Venkatesan
Ranch Hand

Joined: Oct 12, 2006
Posts: 134
Thank you.
 
jQuery in Action, 2nd edition
 
subject: How the values are stored?