import java.util.*;

//----------------------------------------------------------

abstract class SuperHero {
	
	String name = "???";
	boolean hasCape = false;
	String mainAttack = "punch";
	
	SuperHero() 
	{
	}
	
	SuperHero(String n, String a) 
	{
		System.out.println("SuperHero constructor!");
		name = n;
		mainAttack = a;
	}
	
	void attack()
	{
		System.out.println(name + " attacks with a " + mainAttack);
	}
	
	void specialPower()
	{
		System.out.println(name + " has no special power");	
	}
	
	public String toString()
	{
		return name;
	}
}

//----------------------------------------------------------

class IncrediBoy extends SuperHero {
	
	IncrediBoy()
	{
		System.out.println("IncrediBoy constructor!");
		name = "Incrediboy";
		mainAttack = "clumsy punch";
	}
	
	void specialPower()
	{
		System.out.println(name + " flies up to the ceiling and drops down suddenly");	
	}
}

//----------------------------------------------------------

class PantherGirl extends SuperHero {
	
	String familiarName = "Midnight";
	
	/*
	PantherGirl()
	{
		name = "PantherGirl";
		mainAttack = "slash";
	}
	*/
	
	void specialPower()
	{
		System.out.println(name + " summons a magic panther named " + familiarName + " that does triple damage");	
	}
	
	void escape()
	{
		System.out.println("With a mighty roar, " + name + " disappears");
	}
	
	PantherGirl(String s, String a)
	{
		super(s, a);
		System.out.println("PantherGirl constructor!");
	}
}

//----------------------------------------------------------

class GothamCity {
	
	void battle(SuperHero h1, SuperHero h2)
	{
		h1.attack();
		h2.attack();
		h1.specialPower();
		h2.specialPower();
		//h1.escape();
	}
}

//----------------------------------------------------------

public class Inherit {

	
	public static void main(String[] args)
	{
		PantherGirl hero1 = new PantherGirl("pgirl", "slash");  
		IncrediBoy hero2 = new IncrediBoy();
		
		/*
		hero1.attack();
		hero2.specialPower();
		hero1.specialPower();
		*/
		
		/*
		SuperHero[]	Heroes = new SuperHero[2];
		Heroes[0]	= hero1;
		Heroes[1] = hero2;
		
		for (int i = 0; i < Heroes.length; i++)
				Heroes[i].specialPower();
		*/
		
		/*
		ArrayList<SuperHero> A = new ArrayList<SuperHero>();
		A.add(hero1);
		A.add(hero2);
		System.out.println(A);
		*/
		
		/*
		GothamCity G = new GothamCity();
		G.battle(hero1, hero2);
		*/
		
		//SuperHero hero = new SuperHero("genericman", "tah-tah");
		
	}
}

//----------------------------------------------------------
//----------------------------------------------------------