This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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: 14956
    
  26

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 8 API documentation
Aashish Vyas
Greenhorn

Joined: May 09, 2012
Posts: 14

Ohh..now I got that..

thanks Jesper..




 
Have you checked out Aspose?
 
subject: Why can't we declare Outer classes or Top level classes as final ?
 
jQuery in Action, 3rd edition