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

    Aug 1, 2016 · So, you should use boolean rather. Further, we initialize the boolean variable to false to hold an initial default value which is false. In case you have declared it as instance …

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

    Jun 3, 2011 · The default value of any Object, such as Boolean, is null. The default value for a boolean is false. Note: Every primitive has a wrapper class. Every wrapper uses a reference …

  3. Declaring a boolean in JavaScript using just var - Stack Overflow

    Mar 26, 2013 · JS variables don't have a type in the sense that you can't declare a variable that will only hold integers or strings (as happens in some other languages), but the particular …

  4. java - For a boolean field, what is the naming convention for its ...

    There is a markable point between setter/getter method of the data type Boolean and boolean in side a class ( for pojo/entity). For both Boolean and boolean the setter method should be …

  5. initializing a boolean array in java - Stack Overflow

    Mar 2, 2010 · I just need to initialize all the array elements to Boolean false. Either use boolean[] instead so that all values defaults to false: boolean[] array = new boolean[size]; Or use …

  6. Global variables in Java - Stack Overflow

    Jun 6, 2014 · TO DECLARE A VARIABLE AS GLOBAL. 1.Mark the variable as public static final While declaring. TO DECLARE A METHOD AS GLOBAL. 1. Mark the method as public static …

  7. 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 …

  8. java - How to initialize booleans? - Stack Overflow

    Nov 22, 2015 · Java instance variables are automatically initialized either 0 (or equivalent) for numbers, null for objects, or false for booleans. So you don't need to explicitly do it. But you …

  9. Initialization of a boolean with a Boolean.FALSE/.TRUE - why?

    Oct 18, 2012 · The first is more convoluted since it is fetching the static value from the Boolean object and then relying on autoboxing (introduced in 1.5) to change it from a Boolean object to …

  10. How to return a boolean method in java? - Stack Overflow

    Jan 5, 2017 · Edit: Sometimes you can't return early because there's more work to be done. In that case you can declare a boolean variable and set it appropriately inside the conditional …

Refresh