Answer:
//The class definition
public class Questions1_4 {
// main method is defined which signify beginning of program execution
public static void main(String[ ] args) {
// The word "here" is displayed
System.out.print("Here");
// The word "there" is concatenated with "everywhere"
System.out.println("There " + "Everywhere");
// The word "But not" is concatenated with "in Texas"
System.out.println("But not" + "in Texas");
}
}
Explanation:
The program try to show the use of string concatenation. In the code snippet, the last two output statement display string by concatenating them.
The first print statement display "Here" without ending with a new line. The next print statement display "There Everywhere" by concatenating "There" with "Everywhere". The last print statement display "But not in Texas" by concatenating "But not" and "in Texas".
String concatenation means joining pair of string together to form a single string. The "+" operator represent string concatenation in the print statement.