+ 4
What is out is System.out.println
Out resemble is small
3 odpowiedzi
+ 2
Let's us understand this,
. Operator is used for call methods or variables
Methods in Java have parentheses so println is method and out is method
out is start with small letter so it is also not class name
So out must be variable name or object name
Since it is calling a method so it must be object name,
Since it is calling from class name System so it is static object
It is declared in Java as
Public static final PrintStream out;
here PrintStream is class
Let's a look a program for it
public class Goo{
public static String foo;
public static void setFoo(String foo)
{
this.foo=foo;
}}
int l=Test.foo.length(); for printing length
+ 1
"System" is a final class from java.lang package.
"out" is a variable of type PrintStream inside the System class.
"println" is the method that does the printing on the console.
0
output (I assume)