About 15,300,000 results
Open links in new tab
  1. What is null in Java? - Stack Overflow

    Apr 25, 2010 · In Java (tm), "null" is not a keyword, but a special literal of the null type. It can be cast to any reference type, but not to any primitive type such as int or boolean.

  2. Best way to check for null values in Java? - Stack Overflow

    Before calling a function of an object, I need to check if the object is null, to avoid throwing a NullPointerException. What is the best way to go about this? I've considered these methods. …

  3. Java null check why use == instead of .equals() - Stack Overflow

    In Java I am told that when doing a null check one should use == instead of .equals(). What are the reasons for this?

  4. java - What is a NullPointerException, and how do I fix it? - Stack ...

    If a reference variable is set to null either explicitly by you or through Java automatically, and you attempt to dereference it you get a NullPointerException. The NullPointerException (NPE) …

  5. java - How to check if an int is a null - Stack Overflow

    Dec 7, 2012 · In Java there isn't Null values for primitive Data types. If you need to check Null use Integer Class instead of primitive type. You don't need to worry about data type difference. …

  6. How do I avoid checking for nulls in Java? - Stack Overflow

    If null is a valid response, you have to check for it. If it's code that you do control, however (and this is often the case), then it's a different story. Avoid using nulls as a response. With …

  7. java - What does null mean? - Stack Overflow

    Oct 12, 2013 · Formally, null is a singleton member of the null type, which is defined to be the subtype of every other Java type. null is a reference type and its value is the only reference …

  8. java - object==null or null==object? - Stack Overflow

    Because of its commutative property, the only difference between object == null and null == object (the Yoda version) is of cognitive nature: how the code is read and digested by the reader.

  9. Can an int be null in Java? - Stack Overflow

    In Java, int is a primitive type and it is not considered an object. Only objects can have a null value. So the answer to your question is no, it can't be null. But it's not that simple, because …

  10. How to handle “int i != ""” or “int i != null” statements in Java?

    As we know int is a primitive data type and cannot be null. In my program i want to do a condition check like int i != "" but it says operator != cannot be applied to int,null.