explain System.out.println
Answer Posted / vishal
System :
Its a built-in class present in java.lang package.
This class has a final modifier, which means that, it cannot
be inherited by other classes.
It contains pre-defined methods and fields, which provides
facilities like standard input, output, etc.
out :
Its a static final field (ie, variable)in System class
which is of the type PrintStream (a built-in class, contains
methods to print the different data values).
static fields and methods must be accessed by using the
class name, so ( System.out ).
out here denotes the reference variable of the type
PrintStream class.
println() is a public method in PrintStream class to print
the data values.
Hence to access a method in PrintStream class, we use
out.println() (as non static methods and fields can only be
accessed by using the refrence varialble)
System.out.println();
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a nonetype?
What is the final class modifier?
What is a byte string?
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example
Is constructor inherited?
How are multiple inheritances done in Java?
Explain the difference between comparator and comparable in java?
What is 32 bit float?
Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?
How objects of a class are created if no constructor is defined in the class?
How to perform bubble sort in java?
How would you dynamically allocate memory to an array?
Which graphs are functions?
What is private static class in java?
Explain about exception propagation?