JAVA
public classHeMan extends Skeletor {
public void attack() {
super.attack();
System.out.print("heman-A ");
}
public String toString() {
return "heman!";
public classSheRa {
System.out.print("shera-A ");
public void train() {
System.out.print("shera-T ");
return "shera!";
public classBattleCat extends HeMan {
System.out.print("battlecat-A ");
attack();
System.out.print("battlecat-T ");
public classSkeletor extends SheRa {
System.out.print("skeletor-T ");
Given the classes above, what output is produced by the following code?
SheRa[] superheros = {new Skeletor(),new HeMan(),new SheRa(),new BattleCat() };
for (int i = 0; i < superheros.length;="" i++)="">
superheros[i].train();
System.out.println();
superheros[i].attack();
System.out.println(superheros[i]);
Provide your answers in the following blanks in the same order:
train():
attack():
superheros:
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here