Today I came across a thing, is it possible to change the Standard Output Stream?
Then I immediately went for assign the System.out variable.
[code=java]
System.out = new PrintStream(new File("some_file _name"));
[/code]
Then I got a message, the final variable not to be updated.
Then I came to know that I have to take help from API,
[code=java]System.setOut(n ew PrintStream(new File("")))[/code]
So how Java updates the System.out as it's final.
Please help me to know it.
Kind regards,
Dmjpro.
Then I immediately went for assign the System.out variable.
[code=java]
System.out = new PrintStream(new File("some_file _name"));
[/code]
Then I got a message, the final variable not to be updated.
Then I came to know that I have to take help from API,
[code=java]System.setOut(n ew PrintStream(new File("")))[/code]
So how Java updates the System.out as it's final.
Please help me to know it.
Kind regards,
Dmjpro.
Comment