Hi below is an example.I want to know,what does one mean by,
1.create a new class that extends SuperHeroes.
2.have a non static field named: action.

thank you.

abstract class SuperHeroes {

abstract void perform();

}

class Thor extends SuperHeroes {
void perform() { System.out.println("Snap your neck with his hammer"); }
}

class Ironman extends SuperHeroes {
void perform() { System.out.println("Crushes your bones"); }
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.