deriving a class
Hi,
How do you derive a class from another class ? I thought to do something simple like:
class TestBufferextends StringBuffer
{
}
But I get error:The type TestBuffer cannot subclass the final class StringBuffer. What do I do wrong here ?
[402 byte] By [
wmestdagha] at [2007-10-2 20:35:09]

>What do I
> do wrong here ?
Exactly what it says: You tried to extend a final class. Not all classes are meant to be extended. StringBuffer is one that is not, and so was marked as such with the final keyword in its declaration. You'll notice it's final if you look at its Javadocs.
http://java.sun.com/docs/books/tutorial/java/javaOO/final.html
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuffer.html
jverda at 2007-7-13 23:18:21 >
