Question:

Java Programming: the difference between System.out.print and System.out.println?

by  |  earlier

0 LIKES UnLike

Please explain and give examples thx

 Tags:

   Report

3 ANSWERS


  1. it means

    difference between  "print" and  "print and next line"  that's why there is  "ln"  in that out function.

    it prints out a  next line character (equivalent to enter key) after showing that strings.


  2. println() means printing with a new line


  3. System.out.println("foo"); System.out.println("bar"); will result in the output:

    foo

    bar

    System.out.print("foo"); System.out.print("bar"); will result in the output:

    foobar

    Essentially, println just adds a line terminator. The APIs on java.sun.com should help you getting started with Java.

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions