Strings Representing a set of characters altogether, ¬†we can define the data type String is used. For example, Following line declares and initialize a String has an initial value “Welcome to Java” String str = "Welcome to Java"; String is predefined java class same like System, Scanner etc. String is not a primitive data type