Which of the following is a primitive data type in Java?
- ArrayList
- Boolean
- String
- int
In Java, primitive data types are basic data types that store single values. int is one of the primitive data types and is used to store integer values. String, ArrayList, and Boolean are not primitive data types; they are reference data types or classes.
Loading...
Related Quiz
- The ________ method of ExecutorService attempts to stop all actively executing tasks and halts the processing of waiting tasks.
- Consider a scenario where you have a class representing a "User" with a field "password". How would you ensure that the password field is securely encapsulated and cannot be directly accessed or modified without proper validation?
- Which method is used to properly stop a JavaFX application?
- In a class instance, synchronized blocks can be used to avoid locking the entire method and only lock ________.
- Why might a programmer choose to use package-private (default) access level over private for a method within a class?