Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

boolean to char[] to String to integer, how?

Status
Not open for further replies.

navrsalemile

Programmer
Feb 6, 2005
62
CA
Hi all,

I have three boolean variables:

boolean flag1;
boolean flag2;
boolean flag3;

I want to represent them as octal number and convert this octal number into integer represented as String, i.e. if flags are:

flag1 is true
flag2 is false
flag3 is true

then String should be "5" which is binary 5 (0b101).

Maybe shift operator would be better solution, not sure, but I need shortest possible solution

many thanks,
mile
 
Why ?

BTW, please post non-J2EE questions in the Java forum269 .

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top