Question : Why command-line arguments?
c:\>java Adder 10 20
Command line argument
Result is : 30
Explanation of:
[System.out.println();]
System – It is a pre-defined class in java.lang package
out - it is a static variable inside System class of type PrintStream(class reference variable) (i.e.) static PrintStream out;
and PrintStream is a predefined class in java.io package.
Since it is static that’s why we are calling
System.out
So, System.out means we are getting the reference to the object of type PrintStream
println()– It is the method in PrintStream class for Standard output stream.
So to access println method , we need PrintStream object which we are getting through System.out.
So finally its System.out.println---- to produce standard output Stream.
class PrintStream
{
public void
print(String s)
{
-----------
-----------
-----------
}
public void println(String s)
{
-----------
-----------
-----------
}
-------------
-------------
}
{
public static PrintStream out;
-------------
-------------
-------------
}
AE306B0A
ReplyDeleteÇanakkale
Sinop
Kilis
Bitlis
Düzce
Nevşehir
Van
Giresun
Batman
87DBEA67
ReplyDeleteYüreğir
Hendek
Polatlı
Menemen
Ayaş
Datça
Tatvan
Bornova
Erciş
3FC648ED
ReplyDeleteAyaş
Sapanca
Oğuzeli
Söke
Milas
Viranşehir
Ilıca
Artuklu
Ürgüp
CB4E35FB
ReplyDeleteSilivri
Kınık
Talas
Gölhisar
Atakum
Menemen
Karesi
Bayındır
Batum