final Objects

i know this:Final vaariables- cant changedFinal class-- cant subclassed.i need to know about final objects. any help?
[145 byte] By [Er.Vela] at [2007-11-26 13:46:22]
# 1
There's no such thing as a final object.
DrClapa at 2007-7-8 1:21:22 > top of Java-index,Java Essentials,New To Java...
# 2

> 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?

tjacobs01a at 2007-7-8 1:21:22 > top of Java-index,Java Essentials,New To Java...
# 3
could i say it as final label to an object?
Er.Vela at 2007-7-8 1:21:22 > top of Java-index,Java Essentials,New To Java...
# 4
> could i say it as final label to an object?Do you have a code example of what you think that is?
doremifasollatidoa at 2007-7-8 1:21:22 > top of Java-index,Java Essentials,New To Java...
# 5

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.

Er.Vela at 2007-7-8 1:21:22 > top of Java-index,Java Essentials,New To Java...
# 6
> 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
CodeOnFire-againa at 2007-7-8 1:21:22 > top of Java-index,Java Essentials,New To Java...
# 7

> > 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?

warnerjaa at 2007-7-8 1:21:22 > top of Java-index,Java Essentials,New To Java...
# 8

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

DrLaszloJamfa at 2007-7-8 1:21:23 > top of Java-index,Java Essentials,New To Java...