This code uses only a single line System.out.println... statement in order to print "Welcome to Java Illuminated" on one line using the following variables and the String concatenation operator: String s1 = "Welcome ";
String s2 = "to ";
String s3 = "Java ";
String s4 = "Illuminated";
// your code goes here
Answer :
// using + (concat) operator we can concat the strings in
java
System.out.println(s1+s2+s3+s4);
public class HelloWorld {
public static void main(String[] args) {
String s1 = "Welcome ";
String s2 = "to ";
String s3 = "Java ";
String s4 = "Illuminated";
// using + (concat) operator we can concat the strings
in java
System.out.println(s1+s2+s3+s4);
}
}
Note : If you like my answer please rate and help me it is very Imp for me
Get Answers For Free
Most questions answered within 1 hours.