wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Why can't we declare Outer classes or Top level classes as final ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Why can Watch "Why can New topic
Author

Why can't we declare Outer classes or Top level classes as final ?

Aashish Vyas
Greenhorn

Joined: May 09, 2012
Posts: 14
hi .. I wanna know that why can't we declare Outer classes as final classes ??

is there any security reason ?

thanks..
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

What do you mean? You can make a top-level class final, there's no problem with that. Some classes in the standard Java API, such as class java.lang.String, are final top-level classes.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Aashish Vyas
Greenhorn

Joined: May 09, 2012
Posts: 14

Ohh..now I got that..

thanks Jesper..




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why can't we declare Outer classes or Top level classes as final ?
 
Similar Threads
Protected Class?
inner classes
Why static methods can't be defined inside Inner classes
Anonymous classes defined in a method and final var
Inner class & Anonymous class :