fork(1) download
  1. class Test {
  2. private final int myValue;
  3.  
  4. public Test() {
  5. this.initMyValueBitchPlz();
  6. }
  7.  
  8. private void initMyValueBitchPlz() {
  9. this.myValue = 666;
  10. }
  11.  
  12. public static void main (String[] args) {
  13. System.out.println(new Test().myValue);
  14. }
  15. }
  16.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:9: error: cannot assign a value to final variable myValue
    	this.myValue = 666;
    	    ^
1 error
stdout
Standard output is empty