aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Regular Inner classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Regular Inner classes" Watch "Regular Inner classes" New topic
Author

Regular Inner classes

thejaka samarakoon
Ranch Hand

Joined: Jul 20, 2010
Posts: 56

Regular Inner classes either has to be abstract or final(Do we have to define it in the code ?)can you give me a example.


Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

thejaka samarakoon wrote:
Regular Inner classes either has to be abstract or final....


Where did you get this? It's wrong. The keyword abstract and final shouldn't be used together.


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
thejaka samarakoon
Ranch Hand

Joined: Jul 20, 2010
Posts: 56
Abimaran Kugathasan wrote:
thejaka samarakoon wrote:
Regular Inner classes either has to be abstract or final....


Where did you get this? It's wrong. The keyword abstract and final shouldn't be used together.


I want to know that regular inner classes must have a modifier using either abstract or either final not both.
Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 446
    
    1

read the Inner classes chapter from K & B once again

SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Putting abstract or final is not impotant, if you need them you can use one of them for a class. And, it behaves like the top level class in th context of extending, and overiding those classes and methods respectively.
Unmesh Chowdhury
Ranch Hand

Joined: Jun 20, 2010
Posts: 45
The most basic characteristic of a non-static inner class is that, an instance of an inner class must be tied up with an instance of an outer class. Thus, we can think the regular inner class is an instance member of the outer class. Another basic characteristic of regular inner class is that, it cannot have any static context. Whether you will specify the regular inner class as abstract or final (but not both) is totally depended on your requirements. The following is a very basic example of regular inner class:


M.Sc. in CS, OCPJP6 93%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regular Inner classes