The ________ class in Java creates an immutable sequence of characters.
- CharArray
- String
- StringBuffer
- StringBuilder
In Java, the String class creates an immutable sequence of characters. This means that once a string is created, its content cannot be changed. The other options, StringBuilder, StringBuffer, and CharArray, are used for mutable character sequences.
Loading...
Related Quiz
- The ________ data type in Java can store decimal numbers up to 15 decimal places.
- In which scenarios is it recommended to create a custom exception instead of using a standard Java exception?
- In a multi-threaded environment, which class (StringBuffer or StringBuilder) would you primarily use and why?
- Which operator can be used to invert the sign of a numeric expression?
- Which Java method is used to establish a connection to a specified URL?