Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java beginner question: System.out.println

Tags:

java

I am just beginning to learn Java, coming from C background.

How can the line "System.out.println()" be dissected?

like image 537
Geos Avatar asked Nov 28 '22 05:11

Geos


1 Answers

Java is an object-oriented language.

System is a class that contains useful fields and methods. See the API.

out refers to an object that is part of System that is the standard output, so it written as System.out.

println("blah") is a method for System.out that prints a String as a line. When no argument is given (so println()) it prints a blank line.

like image 93
David Johnstone Avatar answered Dec 05 '22 17:12

David Johnstone