Java Strings Evaluation

Questions on Strings

1. String Declaration and Initialization

Explain how to declare and initialize a String in Java. Provide an example of declaring a String variable and initializing it with a value.

2. String Concatenation

Describe how to concatenate two Strings in Java. Provide an example that concatenates two String variables.

3. String Methods

Explain some common String methods in Java, such as length(), substring(), and toUpperCase(). Provide examples of how these methods are used.