Deklarasi Metode Abstrak
public abstract class Multi{
public abstract void multi();//Abstract method declaration
Public void subtract(){
}
}
Outrageous Ostrich
public abstract class Multi{
public abstract void multi();//Abstract method declaration
Public void subtract(){
}
}
abstract class Language {
// method of abstract class
public void display() {
System.out.println("This is Java Programming");
}
}
class Main extends Language {
public static void main(String[] args) {
// create an object of Main
Main obj = new Main();
// access method of abstract class
// using object of Main class
obj.display();
}
}
// create an abstract class
abstract class Language {
// fields and methods
}
...
// try to create an object Language
// throws an error
Language obj = new Language();
abstract void display();