File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Datatypes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Datatypes" Watch "Datatypes" New topic


Angela D'souza
Ranch Hand

Joined: Jan 16, 2002
Posts: 469
I have int i;
I want to extract the bits out the integer, then I want to check it bits on, if on then i want to put it's value into String. How can I do this?
Mark Herschberg

Joined: Dec 04, 2000
Posts: 6037
You can do that using a bitmask. Basically you do a bitwise AND with a mask, designed to pick out the one or more bits you're looking for. You can easily add numbers into Strings using the appropriate String constructor.
I agree. Here's the link:
subject: Datatypes
It's not a secret anymore!