Which of the following data types can store a null value in Java?
- Integer
- String
- double
- int
In Java, only reference data types (objects) can store a null value. Among the given options, String is a reference data type that can store null. The other options are primitive data types and cannot hold null values.
Loading...
Related Quiz
- Consider a case where you have to model a "Book" in a library system. What properties and methods would you define in the Book class and why?
- In a scenario where an application needs to handle a large number of JDBC connections concurrently, how would you optimize the use and management of these connections to ensure application performance is not impacted?
- How is method overloading resolved when there is an ambiguity in method signatures?
- Imagine you are developing a multi-threaded application where threads are performing both read and write operations on shared resources. How would you ensure that the data is not corrupted without degrading performance significantly?
- What will be the output of the following code snippet: System.out.println(10 + 20 + "Hello" + 30 + 40);?