(e) Write the output of the following code:
System.out.print("ALL");
System.out.println(" THE BEST):
Answers
Answered by
2
Question:-
Write the output of the following code.
Output:-
ALL THE BEST.
Explanation:-
Given code,
System.out.print("ALL");
System.out.println(" THE BEST");
After execution of first line,
Output is:- ALL
Now, it will remain in the same line(no new line is added)
Now, second line is executed.
Output:- THE BEST
So, final result:- ALL THE BEST
Answered by
2
Answer:
Output:
ALL THE BEST
Explanation:
There arev2 types of print statement
- System.out.print()- it will print and the cursor will remain in the same line
- System.out.println()- it will print and the cursor will move to next line.
That's why output is "ALL THE BEST"
Similar questions