aspose file tools*
The moose likes Beginning Java and the fly likes Abstract class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Abstract class

gurpreetsingh hora
Greenhorn

Joined: May 27, 2007
Posts: 7
Hi, can someone suggest me why a non-abstract class caanot be extended by abstract class?

is thsi possinle??

class A
{
}

class B extends A
{
}
if yes why??
if no why??
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
Welcome to the Ranch.

But a concrete class (better term than non-abstract) can be extended by an abstract class.
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

Welcome to the JavaRanch gurpreetsingh ,

I tried compiling your example and it compiles. Both A & B are concrete because neither of them is marked with the "abstract" keyword, and neither A nor B needs to be marked as "abstract" because neither of them has any methods that are marked as "abstract".

Please give me more details.

Kaydell
[ May 28, 2007: Message edited by: Kaydell Leavitt ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
. . . and please don't ask the same question twice.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Abstract class