0

If out is a static, final instance object, it must be initialized and cannot be modified.

But it having a default value (of say console) seems to imply the default can be modified. I am therefore confused by the final modifier here. Thanks

Sergio Gliesh
  • 329
  • 1
  • 2
  • 8
  • Can you explain what you mean in more detail? It's not clear how having a default value implies that it can be modified. `final` keeps a variable from being ***re***assigned to. – 4castle Jul 02 '16 at 01:37
  • The use of the word 'default' implies it can be assigned another value. How do I do this if the class is in java.lang? – Sergio Gliesh Jul 02 '16 at 02:00
  • Where are you seeing 'default'? Wherever it is, the wording is being misleading. – 4castle Jul 02 '16 at 02:02
  • The fact that it has a value just means it was initialized, just like `private static final int fred = 3;` Your question isn't clear. – user207421 Jul 02 '16 at 02:05
  • It is from Java- A Complete Reference Guide, Ninth Edition, p. 304. 'System.out refers to the standard output stream. By default this is the console.' – Sergio Gliesh Jul 02 '16 at 02:23
  • A better duplicate: [java: “final” System.out, System.in and System.err?](http://stackoverflow.com/a/5951620/5221149) – Andreas Jul 02 '16 at 03:04

0 Answers0