About 208,000 results
Open links in new tab
  1. object - Boolean vs boolean in Java - Stack Overflow

    Sep 16, 2010 · Basically boolean represent a primitive data type where Boolean represent a reference data type. this story is started when Java want to become purely object oriented it's …

  2. if statement - if (boolean condition) in Java - Stack Overflow

    Oct 4, 2018 · boolean state = "TURNED ON"; is not a Java valid code. boolean can receive only boolean values (true or false) and "TURNED ON"is a String. EDIT: now you are talking about …

  3. Does == check for full equality in Booleans? - Java

    Jun 17, 2012 · - Java. It depends on whether you're talking about Booleans (the object wrapper, note the capital B) or booleans (the primitive, note the lower case b). If you're talking about …

  4. What is the correct way to declare a boolean variable in Java?

    Aug 1, 2016 · First of all, you should use none of them. You are using wrapper type, which should rarely be used in case you have a primitive type. So, you should use boolean rather. Further, …

  5. java - When should I use Boolean instead of boolean ... - Stack …

    Sep 23, 2013 · Boolean - You would get more methods which will be useful. boolean - Will save you lot of memory. But if you use Boolean.valueOf(value) of new Boolean(value), that …

  6. What's the difference between boolean and Boolean in Java?

    Mar 6, 2014 · In Java, a boolean is a literal true or false, while Boolean is an object wrapper for a boolean. There is seldom a reason to use a Boolean over a boolean except in cases when an …

  7. java - switch / case request with boolean - Stack Overflow

    public void checkLoginData(final String username, final String password){ boolean user = username.length() >= 6; boolean pass = password.length() >= 6; boolean[] logindaten = {user, …

  8. java - How to get boolean user input using scanner ... - Stack …

    Feb 6, 2015 · So i have to ask the user whether they are above 18 and they have to answer with a true or false. And keep looping until they enter the right input So far, i have this boolean b = …

  9. SonarLint Use the primitive boolean expression here

    Nov 25, 2019 · The best option in terms of safety and readability is to use this construction. Boolean.FALSE.equals(properties.getEnabled()) As Boolean.FALSE will return you a Boolean …

  10. boolean operations - How to use 'or' in Java? - Stack Overflow

    The equals method returns a boolean and the || operator wants two booleans on each side. You're doing an action.equals("run") on one side but then a ("sprint") on the other which isn't a …