The Artima Developer Community
Sponsored Link

Java Answers Forum
final abstract class

2 replies on 1 page. Most recent reply: Aug 4, 2003 3:37 PM by Java Learner

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Java Learner

Posts: 3
Nickname: learn78
Registered: Aug, 2003

final abstract class Posted: Aug 4, 2003 12:46 PM
Reply to this message Reply
Advertisement
Can we declare --> final abstract class


Mr Plow

Posts: 18
Nickname: mrplow
Registered: Jun, 2003

Re: final abstract class Posted: Aug 4, 2003 1:56 PM
Reply to this message Reply
No you can not declare an abstract final class. The compiler will not let you compile this as the modifiers (final and abstract) indicate totally opposite inheritance functionality for the class on which they are used.

The final keyword when used with regards to a class means that the class can not be extended. For example the java.lang.String class is a final class and can not be used as a parent class in inheritance.

The absract keword when used with regards to a class indicates that the class can not be instantiated and instead is designed for extension.

Java Learner

Posts: 3
Nickname: learn78
Registered: Aug, 2003

Re: final abstract class Posted: Aug 4, 2003 3:37 PM
Reply to this message Reply
Thank you thats really helpful

Flat View: This topic has 2 replies on 1 page
Topic: Writing a Log File Previous Topic   Next Topic Topic: What is it doing ?!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use