• Post Reply Bookmark Topic Watch Topic
  • New Topic

Concrete Class  RSS feed

 
Anil Kumar V
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know an abstract class cannot instantiated.

Can we call all class except abastract class as concrete class including derived classes of abstract classes, implemented classes of interfaces etc ?

--Anil Kumar




 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.

A concrete class is one which is not abstract and can therefore be instantiated. link
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anil Kumar V wrote:I know A concrete cannot instantiated.
That bit is incorrect
Can we call all class except abastract class as concrete class including derived classes of abstract classes, implemented classes of interfaces etc ?

--Anil Kumar
…but that bit is correct. Any non‑abstract class which can be instantiated. I am not sure what you call classes like this which are not abstract but cannot be instantiated, not even via factory methods. I know that is a utility class, but am not sure whether you would call them concrete.
 
Bin Smith
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Concrete class is class that must implement all abstract methods of super hierarchy.
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But what if there are not abstract methods in its hierarchy?
 
Mike. J. Thompson
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would personally call any class that has no abstract methods a concrete class, including classes with private constructors such as utility classes. You could probably still instantiate those via reflection anyway.

 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike. J. Thompson wrote:I would personally call any class that has no abstract methods a concrete class, . . .
Even if the class is marked abstract?
 
Anil Kumar V
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Campbell Ritchie,

Refer My first bit
"I know A concrete cannot instantiated." That is wrongly typed. The correct one is "I know an abstract class cannon instantiated"

Thanks for reply...

So finally we can call all classes as concrete classes except abstract classes.. Is it correct ?

Anil Kumar.
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It woiuld appear so, yes.

And … you're welcome
 
Mike. J. Thompson
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:
Mike. J. Thompson wrote:I would personally call any class that has no abstract methods a concrete class, . . .
Even if the class is marked abstract?


Quite right, I meant to say if it's not abstract. Not if it has no abstract methods.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!