System.out & System.in are final static data member of System
class but we can change there reference through setOut() &
setIn() method how...
Answers were Sorted based on User's Feedback
Answer / rupakbhuyan
The System class provides the static methods setIn(),
setOut(), and setErr() for this purpose. The setIn() method
requires an argument of type InputStream that specifies the
new source of standard input. The other two methods expect
an argument of type PrintStream.
| Is This Answer Correct ? | 6 Yes | 4 No |
Answer / vikas
but the Final method have there behavior to not get change but it get change through setIN() & setOut() methods how...
i know it is used to change its reference but why it get change if it is a final method...
| Is This Answer Correct ? | 0 Yes | 1 No |
When should you make a function static?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
What are "methods" and "fields"?
What is collection sort in java?
How can you share data between two thread in Java?
How do you compare objects in java?
What are inner classes or non static nested classes in java?
When will we use class loader?
Under what conditions is an object’s finalize() method invoked by the garbage collector?
What is final access modifier in java?
What is the best definition for data?
Which is the best way of exception handling?