From the Java Tutorial I came to know about he final keyword and a example....... final int aFinalVar = 3; and it also says that a variable once called as final can't be initialized more that once. i.e. it's like const of C++. Now my question is that can I change init it with other variables ofcourse once. like: int x = 20; final int finalVar = x;
<b><i>We all are the components of a huge program...... the programmer is always debugging us with His debugger.</b></i>
posted 13 years ago
Yes, in fact since you can initialize your final vars in your constructors, they are often initialized with a parameter passed into the constructor.