public class Solution { //class
public static void main(String[] args) {//main
System.out.println("Hello, World.");//printing Hello, World.on new line.
System.out.println("Hello, Java.");//printing Hello, Java on new line
}
}
output:
Hello, World.
Hello, Java.
explaination: System.out.println("Text to be printed"); is used to print on new line
and System.out.print(" "); is used to print on same line.
No comments:
Post a Comment