Defining Abstract Classes

Q

How to define an Abstract class?

✍: FYIcenter

A

Defining an abstract class is done using the keyword "abstract". Here is an example of abstract class:

abstract class MyAbstract {
   protected String myString;
   public String getMyString() {
      return myString;
   }
   public abstract string getMyStringInYourWay();
} 

2007-03-03, 5065👍, 0💬