Output Statements In java

How many types of output statements are there in Java ?

There are mainly two output statements in Java.

1. Print()

2. Println()

Both the function is used to print output statement on console or output device. Their

a. Package is lang (language)

b. defined in system class 

c. belongs to Printstream static member field of system class and out is the instance (say object) of printstream type.

So, we write System.out.println() or System.out.print()

Then what is difference between print() and println() ?

The main difference is that println() changes a line after printing its argument while print() don't.

Here a program link is given below compile and run on any IDE you will understand the concept more !!!

Write a program to make difference between print() and println() .

For any desired program, please comment below. We will try our best to make that program available.


Comments

Popular Posts