- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
- Related Articles
- What is the Eclipse keyboard shortcut for "System.out.println()" in Java?
- What is the difference between Java and Core Java?
- What is the difference between Java and Java EE
- What is the difference between >> and >>> operators in Java?
- What is the difference between /* */ and /** */ comments in Java?
- What is the difference between Java and JavaScript?
- What is the difference between object and reference in java?
- What is the difference between Serialization and Deserialization in Java?
- What is the difference between PATH and CLASSPATH in Java?
- What is the difference between ArrayList and LinkedList in Java?
- What is the difference between compositions and aggregations in Java?
- What is the difference between abstraction and encapsulation in Java?
- What is the difference between transient and volatile in Java?
- What is the difference between equals and compareTo in Java?
- What is the difference between StringBuffer and StringBuilder in java?

Advertisements