#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    Error use for parseBoolean


    I'm getting error on this code on eclipse editor, can anyone explain me why. I try to execute this code in this site
    compileonline[.]com
    But no error here

    Code:
    public class Boolean {
    
    	/**
    	 * @param Boolean
    	 */
    	public static void main(String[] args) {
    		boolean b1 = true;
    		boolean b2 = false;
    		
    		System.out.println("The value of b1 is " + b1);
    		System.out.println("The value of b2 is " + b2);
    		
    		boolean b3 = !b1;
    		System.out.println("The value of b3 is " + b3);
    		
    		int i = 0;
    		boolean b4 = (i != 0);
    		System.out.println("The value of b4 is " + b4);
    
    		String s = "true";
    		boolean b5 = Boolean.parseBoolean(s);
    		System.out.println("The value of b5 is " + b5);
    	}
    }
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,730
    Rep Power
    1959
    Great to see you used the code tags, but you should also post the error messages you received.

    You should try not to call your class Boolean, or something that already exists in Java codebase.
    Alternative, you will have to add the correct namespace when you want to use the standard Java (Boolean) class.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    7
    Rep Power
    0
    i have been trying to run a java program on a windows 7 dual core laptop but it keeps showing errors,but i ran it on another laptop of the same configuration and it worked fine. What's the problem with my laptop?
  6. #4
  7. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,724
    Rep Power
    348
    it keeps showing errors
    Can you copy the full text of the error messages and paste it here?

IMN logo majestic logo threadwatch logo seochat tools logo