In java to print a message on console normally use System.out.print() method. the description of this method as-
System-> 'System' is a class. which exists in java.lang package.
out -> 'out' is the object of class PrintStream. which is exists in 'java.io' package.
out is also final or static. so it can we directly access by the name of the class
like 'System.out'.
print()-> it is a method of the PrintStream class. which is access by the 'out' object of that class in 'System' class.
So to access the print method we write
System.out.print();
For Further Reading,
0 comments:
Post a Comment