473,378 Members | 1,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

What is wrong with the following java boolean codes?

108 100+
I want to parse a string into a boolean value and I implemented this script ..

public static void test_lang_boolean(){


System.out.println("boolean false from string "+Boolean.parseBoolean("Boolean.FALSE"));
System.out.println("boolean true from string "+Boolean.parseBoolean("Boolean.TRUE"));
}


When I run this code,I get false for both..
I expected to get false for the first one and true for the second ..
Any1 can show me what's wrong here...

Thanks in adv
Jul 7 '10 #1
1 1793
Oralloy
985 Expert 512MB
Try

Expand|Select|Wrap|Line Numbers
  1. public static void test_lang_boolean(){
  2.  
  3.  
  4. System.out.println("boolean false from string "+Boolean.parseBoolean("FALSE"));
  5. System.out.println("boolean true from string "+Boolean.parseBoolean("TRUE"));
  6. }
  7.  
Jul 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: John Smith | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <div id="navcontainer"> <ul...
1
by: mike | last post by:
regards: My program logic is following: http://www.wretch.cc/album/show.php?i=otp&b=1&f=1114017894&p=4 from Step1 to Step4 Any positive suggestion is welcome. thank you May goodness be...
4
by: Rick Ng Chi Wah | last post by:
Dear all, I am a beginner of C language. I want to know following C terminologies: preprocessor complier object code linker executable file
2
by: chenboston | last post by:
I am learning STL and write my own simple codes to test the examples. When I compile (g++ -c -o A.o A.C) I got "A.h:13: error: parse error before `<' token". This must be a simple problem, just...
1
by: fAnSKyer/C# newbie | last post by:
private void startupServer() { try { serverscoket = new ServerSocket(Listener.PORTNUMBER); SERVER_ON = true; } catch (IOException e1) { e1.printStackTrace(); } } public void run() {
2
by: kutzi_lala_yey | last post by:
If You were hired by a gasoline firm to create a program that will tell whether which route is faster and which route is more likely to be fuel efficient separately. A test car was provided for you...
6
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Please help me convert the following Java to C# class ProgramChoice { private Class cls; private String text; ProgramChoice(String text, Class cls) { this.cls = cls; this.text = text; }
1
by: rooky13 | last post by:
I am working on an assignment for my class (don't worry you're not doing my homework for me). I want to have a method that asks the user a yes/no question specifically "did you pay due?" but the way...
3
by: muddasirmunir | last post by:
I am trying to give the following Icon in my form in vb6. http://www.mediafire.com/?ymzgkgyi50j But , when I put this in my form I got error "Invalid Picutre" What wrong in it? How to add...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.