473,425 Members | 1,561 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,425 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 1798
Oralloy
988 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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.