Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7846825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:43:11+00:00 2026-06-02T17:43:11+00:00

When i tried to convert a String Object to boolean , the result is

  • 0

When i tried to convert a String Object to boolean, the result is different.

String strFlag="true";
boolean boolFlag = Boolean.getBoolean(strFlag);

boolFlag ends up having a false value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:43:13+00:00Added an answer on June 2, 2026 at 5:43 pm

    Use Boolean.valueOf(String string) to archieve your goal.

    boolean boolFlag = Boolean.valueOf(strFlag);
    

    Returns a Boolean with a value represented by the specified String. The Boolean returned represents the value true if the string argument is not null and is equal, ignoring case, to the string “true”.

    Example: Boolean.valueOf("True") returns true.

    Example: Boolean.valueOf("yes") returns false.

    As of java 1.5 there’s also Boolean.parseBoolean(String s) which returns the primitive type boolean instead of the boxed type Boolean to spare some CPU cycles in most cases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I convert string 2010-11-19T20:00:00Z into an NSDate object? I've tried using [dateFormatter
How can I convert a C++ std::string object into a Ruby VALUE object? I
I tried many things but I always get cannot convert string to membershipuser from
I'm trying to convert std::string to float/double . I tried: std::string num = 0.6;
I want to convert a string like 2012-03-08T00:00:00+01:00 into Date.. I tried to use
When I tried to convert something like 0.1 (from user in textbox), My value
I have this JSON string: { success:true,user_id:309,id:309,sessId:false,email:null,name:Mai Van Quan,username:quanmv,role:Reseller Admin,messages:,org_name:null,microPayNumber:4949,microPayWord:neocam,mobile:null,permissions:{ADD_CAMERA:true, REMOVE_CAMERA:true, EDIT_CAM_GENERAL:true, ACCESS_CAM_TECHNICAL:true, EDIT_CAM_PKG:true,
How can I convert a string into uppercase in Python? When I tried to
Hey, just wondering how to convert an HH:MM string into a javascript Date object.
I tried to convert a string to date in perl, but get error. use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.