Results 1 to 3 of 3
Thread: boolean to string
- 01-30-2008, 03:23 AM #1
Member
- Join Date
- Jan 2008
- Posts
- 5
- Rep Power
- 0
boolean to string
I'm reading lines from a file and one of the value is boolean.
accountStatus is boolean causes an error. I have tried this:Java Code:while ((aRecord=ins.readLine())!= null) { strings = new StringTokenizer(aRecord,"?"); //toekenizer if (strings.countTokens() == 3) { accountName = strings.nextToken(); accountPhone = strings.nextToken(); accountStatus = strings.nextToken(); //this is boolean }
still doesn't seem to work.Java Code:accountStatus = strings.nextToken();
- 01-30-2008, 04:20 AM #2
You can omit .booleanValue for Java 1.5+ because of autoboxing ..Java Code:accountStatus = new Boolean(strings.nextToken()).booleanValue();
dont worry newbie, we got you covered.
- 01-30-2008, 05:31 AM #3
Member
- Join Date
- Jan 2008
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Error: incompatible types, found: int required: boolean
By silvia in forum New To JavaReplies: 6Last Post: 10-08-2008, 08:09 AM -
Accessing boolean Values of another values in one class.
By a_iyer20 in forum Advanced JavaReplies: 4Last Post: 04-15-2008, 01:04 PM -
boolean variables
By ravian in forum New To JavaReplies: 3Last Post: 12-31-2007, 04:58 AM -
Using java.util.Scanner to search for a String in a String
By Java Tip in forum Java TipReplies: 0Last Post: 11-20-2007, 04:59 PM -
Boolean Expression
By ritwik07 in forum New To JavaReplies: 3Last Post: 07-11-2007, 04:11 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks