is string a keyword in java?

No, String is not a keyword in java. String is an object which is created by using String class. String objects are immutable and they can’t modified i.e. any change in the existing object will result into a new object.

Example

public class Main {
 
    public static void main(String[] args) {
        String language = "java";
        System.out.println("Language: " + language);
        String website = new String("w3spoint.com");
        System.out.println("Website: " + website);
    }
}

Output

Language: java
Website: w3spoint.com

Java interview questions on String Handling

Content Protection by DMCA.com
Please Share