Java Abstract Class

Java Abstract Class:

We can use the Eclipse IDE for this example. If you do not know about it then follow this link- How to Install Eclipse For Java and create a program in it.
  • An abstract class is declared using the keyword abstract.
  • It may or may not contain abstract methods.
  • An abstract class must be inherited by some other class.
  • If the derived class does not provide the implementation of any abstract method present in an abstract class, the derived class must be declared as abstract.
  • Objects of an abstract class cannot be created, but reference can be created.
  • Through the reference of an abstract class, only methods of the abstract class implemented in the derived class can be called.
  • The abstract keyword cannot be applied to static methods or constructors.
Java Abstract Class Code1
Java Abstract Class Code2
abstract class Base
{
   abstract void show();	
}

class first extends Base
{
	void show()
	{
		System.out.println("show of first");
		
	}

}

class second extends Base
{
	void show()
	{
		System.out.println("show of second");
		
	}

}

abstract class third extends Base
{
   
}

public class Abstract_method {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Base b = new first();
		b.show();
		b = new second();
		b.show();

	}

}

MySQL Insert Query (Single Row and Multiple Row)
MySQL Logical Operators
MySQL Limit and Offset Clause
MySQL Aggregate Functions
Email (Electronic Mail)
Database Models or Data Models

Information Security in E-Commerce

Java (programming language)– Wikipedia

Comments (No)

Leave a Reply