View Single Post
  #1 (permalink)  
Old 12-13-2007, 10:52 AM
ravian ravian is offline
Senior Member
 
Join Date: Nov 2007
Posts: 115
ravian is on a distinguished road
FInal field cannot be assigned
I have following code which raises exception:
Code:
public class Test { static final int STACK_EMPTY = -1; static int STACK_FULL = 10; public static void main(String[] args) { STACK_FULL = 12; STACK_EMPTY = 2; } }
Exception:
Code:
The final field Test.STACK_EMPTY cannot be assigned
If you cant reassign value to a final attribute, then what is the use of it?
Reply With Quote
Sponsored Links