> i know this:
> Final vaariables- cant changed
actually they can be changed, but the variable itself cannot be reassigned
So you can do
final Object[] objs = ...
objs[0] =
but you can't do
objs = ...
> Final class-- cant subclassed.
>
> i need to know about final objects. any help?
Is there such a thing?
the code is actually quite a junk.
whats happening is , in a class the decl is as
final Object obj= new Object;
then this obj is passed to another function in another class where it is not treated as final. Since i thought the that the final keyword is for object, i got little confused. But, when i took the final Key word is for the handle to the object, then every thing looks clear.
> > i know this:
> > Final vaariables- cant changed
> > Final class-- cant subclassed.
> >
> > i need to know about final objects. any help?
>
> a final class is an object once instantiated
Any class is an object once instantiated, so 'final' in this context doesn't mean anything.
Did you sign up on this site just to post inaccurate and wrong answers on purpose or what?
final Point pt = new Point(10,66);
This is an example of a final variable. But be careful to distinquish between the variable pt and the object it refers to: that Point object can be changed. The effect of final is to prevent (further) assignment to pt:
pt.x += 1; //legal
pt = new Point(11,66); //syntax error