Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
What is the difference between System.out.println() and System.out.print() in Java?
The println() terminates the current line by writing the line separator string. The print() method just prints the given content.
Example
public class Sample {
public static void main(String args[]) {
System.out.println("Hello");
System.out.println("how are you");
System.out.print("Hello");
System.out.print("how are you");
}
}
Output
Hello how are you Hellohow are you
Advertisements
