What will be the output of the following program?
class HelloWorld
{
public static void main(String t[])
{
System.out.println("Hello World");
System.out.println("Hello Universe");
}
}
}
Answers
Answered by
4
Required Answer:-
Given Code:
class HelloWorld {
public static void main(String t[]) {
System.out.println("Hello World");
System.out.println("Hello Universe");
}
}
Output:
Hello World
Hello Universe
Explanation:
- The println() function is used to print messages on the screen and moves the cursor to the next line.
- So, after displaying the first message i.e., "Hello World", the cursor is moved to the next line.
- Again, a new message i.e., "Hello Universe" is displayed on the screen with a new line.
See the attachment for output.
•••♪
Attachments:
Answered by
0
Answer:
I have attached the program with the output see it.
Attachments:
Similar questions