The ________ reference data type in Java is immutable and stores a sequence of characters.
- String
- StringBuilder
- List
- Array
The String class in Java is an immutable reference data type that stores a sequence of characters. Being immutable means that once a String object is created, its content cannot be changed. Understanding the immutability of strings is crucial for efficient string manipulation in Java.
Loading...
Related Quiz
- Which of the following statements correctly initializes a two-dimensional array in Java?
- In which phase of the Merge Sort algorithm is the majority of the processing work done?
- What will be the outcome if you try to execute a DML (Data Manipulation Language) operation using executeQuery() method?
- In a case where you are working with a multi-threaded application where multiple threads need to write to a single log file, how would you ensure that the writes to the file are thread-safe and that the data is not corrupted?
- Consider a scenario where you are required to store a large number of decimal values with high precision for a financial application. Which data type would be preferable and why?