About 197,000 results
Open links in new tab
  1. What is the correct way to declare a boolean variable in Java?

    Aug 1, 2016 · For instance Java has default values for Boolean, int etc .. C on the other hand doesn't automatically give initial values, whatever happens to be in memory is what you end up with unless …

  2. Default value of 'boolean' and 'Boolean' in Java - Stack Overflow

    Jun 3, 2011 · What are the default values of boolean (primitive) and Boolean (primitive wrapper) in Java?

  3. initializing a boolean array in java - Stack Overflow

    In Java arrays are created on heap and every element of the array is given a default value depending on its type. For boolean data type the default value is false.

  4. object - Boolean vs boolean in Java - Stack Overflow

    Sep 16, 2010 · There are discussions around Integer vs int in Java. The default value of the former is null while in the latter it's 0. How about Boolean vs boolean? A variable in my application can have …

  5. java - How to compare Boolean? - Stack Overflow

    In the first scenario, the Boolean will be unboxed into its respective boolean value and compared as normal. In the second scenario, you are invoking a method from the Boolean class, which is the …

  6. Why boolean in Java takes only true or false? Why not 1 or 0 also?

    Jan 6, 2010 · 65 Java, unlike languages like C and C++, treats boolean as a completely separate data type which has 2 distinct values: true and false. The values 1 and 0 are of type int and are not …

  7. java - What is the most elegant way to check if all values in a boolean ...

    In Java 8+, you can create an IntStream in the range of 0 to myArray.length and check that all values are true in the corresponding (primitive) array with something like,

  8. java - When should null values of Boolean be used? - Stack Overflow

    Jun 25, 2012 · Java boolean allows values of true and false while Boolean allows true, false, and null. I have started to convert my booleans to Booleans. This can cause crashes in tests such as Boolean …

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

    Oct 4, 2018 · The if statement will evaluate whatever code you put in it that returns a boolean value, and if the evaluation returns true, you enter the first block. Else (if the value is not true, it will be false, …

  10. How to check if two boolean values are equal? - Stack Overflow

    Jul 12, 2015 · I need a method which I can call within the junit assertTrue() method which compares two booleans to check if they are equal, returning a boolean value. For example, something like this: …