Types of classess in Java?

Types of classes in Java:~

There are two types of classes in Java. They are:

  • Concrete classes
  • Abstract classes

Concrete Class:

A class is said to be concrete class if and only if it contains fully defined methods. Fully defined methods are known as implemented or concrete methods.

Once a class is concrete than we can create object of that class directly.

 

class B

{

int x,y;

void add()

{

…………

…………

}

void sub()

{

…………

…………

}

}

 

Abstract Class:

  • A class is said to be an abstract class if and only if contains some defined and some undefined methods.
  • With respect to an abstract class we can’t create an object of that class directly but we can create an object of abstract class indirectly.

abstract class B

{

abstract void add();

void add1()

{

--------------

}

}

1 Comment

  • Needed to send you a bit of remark just to say thank you the moment again considering the gorgeous opinions you have shared on this page. This is certainly incredibly open-handed with you in giving openly precisely what most of us could have sold as an e book to end up making some money for their own end, and in particular seeing that you might have done it if you decided. Those advice in addition served like a fantastic way to realize that other individuals have similar eagerness like my own to know much more in respect of this condition. I believe there are lots of more fun instances ahead for those who looked at your website.

Leave a Reply