More about Java Output | System.out.print()

In our previous posts or you can say blog we have discuss about how can we get output in  C#,  C++.  Now we shall discuss about how can we get Java Output or print something and then get output of that using a simple line of code okay.

java output

Now How can we Print Text for Java Output

You have learned from the previous post or blog you can say that you can use the println() method to output values or print text in Java:

Example:

System.out.println("Hello World!!!");

Output

Hello World!!!

NOTE: We can print text or number or values on screen by two ways using Print() method and Println() method also.

Now let’s try both method and see difference in their output okay

Print() Method for Java Output

Now we can print our text or number to screen using this method. See code or syntax of this line under below:

System.out.print("Hello buddy, Codelikechamp is great website to learn programming!!");
System.out.print("Oh!! really thanks for sharing");

Output

Hello buddy, Codelikechamp is great website to learn programming!!Oh!! really thanks for sharing

Now we use Println() method and see the output:

Println() Method

It’s serves same funtionality i.e for printing , but one thing is different let see :

System.out.print("Hello buddy, Codelikechamp is great website to learn programming!!");
System.out.print("Oh!! really thanks for sharing");

Output

Hello buddy, Codelikechamp is great website to learn programming!!
Oh!! really thanks for sharing

NOTE: That Print() & Println() both methods print our text but Print() methods does not insert new line while Println() methods inserts okay this is the main difference i hope you got it.

Print Numbers

we can also print numbers to our screen using these methods.

NOTE: However, unlike text, we don’t put numbers inside double quotes, because numbers have different datatype i.e String .

System.out.println(1);
System.out.println(10);
System.out.println(100)

Output

1
10
100

Now in next blog or post we will discuss about comments in Java how to create it or what is the purpose of comments okay.

Link: https://Codelikechamp.com

Medium Link: Follow me on Medium

Linkedin Link: Follow me on Linkedin

🤞 Don’t miss any latest posts!

Please subscribe by joining our community for free and stay updated!!!

IF YOU HAVE ALREADY SUBSCRIBED JUST CLOSE THIS FORM !

14 thoughts on “More about Java Output | System.out.print()”

  1. Hey excellent website! Does running a blog like this take a
    lot of work? I’ve no knowledge of computer programming however
    I was hoping to start my own blog in the near future. Anyhow, should
    you have any recommendations or techniques for
    new blog owners please share. I know this is off subject nevertheless I just had to ask.

    Cheers!

  2. Good day! I could have sworn I’ve been to this site before but
    after checking through some of the post I realized it’s new to me.
    Nonetheless, I’m definitely glad I found it and I’ll be bookmarking and checking back often!

  3. Hey are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get
    started and create my own. Do you need any coding expertise to make your own blog?

    Any help would be greatly appreciated!

  4. Everyone loves what you guys are usually up too.
    Such clever work and reporting! Keep up the superb works guys I’ve incorporated
    you guys to my personal blogroll.

  5. of course like your web-site but you have to take a look at
    the spelling on quite a few of your posts. Many of them are rife with spelling problems and I in finding it very troublesome to inform the truth however I will certainly come back again.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top