Planets
P.Komisar
class Planets3{
public static void main(String[] args){
String s1= "Mercury";
String s2="Venus";
String s3="Earth";
System.out.println("The planets of the solar system
are \n" +
s1 + ", " + s2 + " and " + s3 + ".");
}
}
// The + signs can be used for
addtion but also to concatenate strings together.
// the \n is an example of what
is called an escape sequence and is used here to
// cause the output to be placed
on a new line.
Excercise
First you should run this class. Then, having noticed the programmer
didn't finish the job,
complete the program by adding the missing planets. Rename the class
appropriately.