[2533] in java-interest

home help back first fref pref prev next nref lref last post

Re: Static class VS final class

daemon@ATHENA.MIT.EDU (Pat Niemeyer)
Wed Oct 4 02:30:47 1995

Date: Tue, 3 Oct 1995 23:44:18 -0500 (CDT)
From: Pat Niemeyer <pat@icon-stl.net>
To: black@velocity.com
cc: java-interest@java.sun.com
In-Reply-To: <9510031420.AA16003@velocity.com>



On Tue, 3 Oct 1995, Ben Black wrote:

> >  Can someone explain the different between a static class and a final class
> >for me?  Both of them cannot be subclassed and instantiated.
> >
> anyone who knows better, please feel free to correct me.  in objective-c  
> (and, i would assume, java) a static class can only be instantiated once.   
> static variables within a class (again, in objective-c) are class variables  
> (shared by every instance of the class) and are not inherited.  a final class  
> is one which has been frozen.  there is really no difference between a final  
> class and any other class, other than the fact that subclassing it is not  
> allowed.
> 
> (waiting for someone smart to enumerate my mistakes in the above paragraph)

I will defer to someone smart as well ;)

What you've said is correct with the exception that there are no static
classes as such.  A class with only static variables and methods however
would be close.


Pat
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post