Java 无法调用Pokemon类中的对象

Java 无法调用Pokemon类中的对象,java,Java,我有三个名为Pokemon.java、Move.java和PokemonTrainer.java的类,它们包含创建和修改Pokemon、它们的移动和它们的训练器的方法。我已经创建了所有必需的方法,但是调用我在PokemonSimulation.java类中创建的Pokemon对象时遇到问题,程序总是无法编译,错误为“java:56:error:not find symbol”。我怎样才能解决这个问题 以下是Pokemon.java的代码: import java.util.ArrayList;

我有三个名为Pokemon.java、Move.java和PokemonTrainer.java的类,它们包含创建和修改Pokemon、它们的移动和它们的训练器的方法。我已经创建了所有必需的方法,但是调用我在PokemonSimulation.java类中创建的Pokemon对象时遇到问题,程序总是无法编译,错误为“java:56:error:not find symbol”。我怎样才能解决这个问题

以下是Pokemon.java的代码:

import java.util.ArrayList;
public class Pokemon
{
    // Copy over your code for the Pokemon class here
    // Private constants
    private static final int MAX_HEALTH = 100;
    private static final int MAX_MOVES = 4;
    private String name;
    private int health;
    private int opponentHealth;
    public static int numMovesForPokemon = Move.getNumOfMoves();
    private Move move;
    private ArrayList<Move> moveListForPokemon;
    private String pokemonImage;

    // Write your Pokemon class here
    public Pokemon(String theName, int theHealth)
    {
        name = theName;
        if(theHealth <= MAX_HEALTH)
        {
            health = theHealth;
        }
        moveListForPokemon = new ArrayList<Move>();
    }

    public Pokemon(String name, String image)
    {
        this.name = name;
        health = 100;
        pokemonImage = image;
    }

    public Pokemon(String theName)
    {
        name = theName;
        health = 100;
        pokemonImage = theName;
    }    

    public void setImage(String image)
    {
        pokemonImage = image;
    }

    public String getImage()
    {
        return pokemonImage;
    }

    public String getName()
    {
        return name;
    }

    public int getHealth()
    {
        return health;
    }

    public void setHealth(int health)
    {
        this.health = health;
    }    

    public boolean hasFainted()
    {
        if(health <= 0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public boolean canLearnMoreMoves()
    {
        if(numMovesForPokemon < 4)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public boolean learnMove(Move other)
    {
        if(canLearnMoreMoves())
        {
            moveListForPokemon.add(other);
            numMovesForPokemon++;
            return true;
        }
        else
        {
            return false;
        }
    }

    public void forgetMove(Move other)
    {
            moveListForPokemon.remove(other);
    }

    public ArrayList<Move> getMoves()
    {
        return moveListForPokemon;
    }

    public boolean knowsMove(Move move)
    {
        if(moveListForPokemon.contains(move))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public boolean knowsMove(String moveName)
    {
        int doesListContainName = 0;
        for(Move m : moveListForPokemon)
        {
            if(m.getName() != null && m.getName().equals(moveName))
            {
                doesListContainName = 1;
            }

        }

        if(doesListContainName == 1)
        {
            doesListContainName = 0;
            return true;
        }
        else
        {
            return false;
        }
    }

    public boolean attack(Pokemon opponent, Move move)
    {
        if(knowsMove(move))
        {
            opponentHealth = opponent.getHealth();
            opponentHealth -= move.getDamage();
            opponent.setHealth(opponentHealth);
            return true;
        }
        else
        {
            return false;
        }
    }

    public boolean attack(Pokemon opponent, String moveName)
    {
        if(knowsMove(moveName))
        {
            opponentHealth = opponent.getHealth();
            for(Move m : moveListForPokemon)
            {
                if(m.getName() != null && m.getName().equals(moveName))
                {
                    opponentHealth -= m.getDamage();
                }
            }
            opponent.setHealth(opponentHealth);
            return true;
        }
        else
        {
            return false;
        }
    }    

    public String toString()
    {
        return pokemonImage + "\n" + name + " (Health: " + health + " / " + MAX_HEALTH + ")";
    }
    // Add the methods specified in the exercise description
}
import java.util.ArrayList;
公共类口袋妖怪
{
//在这里复制你的口袋妖怪类代码
//私有常数
私有静态最终int MAX_HEALTH=100;
私有静态最终整数最大移动=4;
私有字符串名称;
私人卫生;
私人对立面;
public static int numMovesForPokemon=Move.getnummofmoves();
私人搬家;
私人ArrayList moveListForPokemon;
私有字符串pokemonImage;
//在这里写下你的口袋妖怪类
公共口袋妖怪(字符串名称,int theHealth)
{
名称=名称;
如果(theHealth=4)
{
对不起,你不能再教“+口袋妖怪+”更多的动作了;
System.out.println(“”);
打破
}
其他的
{
System.out.println(口袋妖怪+“已经学会了他们所有的招式”);
System.out.println(“”);
}
}
}
其他的
{
System.out.println(口袋妖怪+“已经学会了他们所有的招式”);
System.out.println(“”);
}
System.out.println(“选择你的第二个口袋妖怪”);
pokemoname=readLine(“输入您的口袋妖怪的名称:”);
System.out.println(“您选择:”);
if(口袋妖怪名称。相等信号案例(“皮卡丘”)||口袋妖怪名称。相等信号案例(“魔术师”)|口袋妖怪名称。相等信号案例(“布尔巴索”)| |口袋妖怪名称。相等信号案例(“斯奎特尔”))
{
pokemonp4=新的Pokemon(pokemoname,images.getPokemonImage(pokemoname));
系统输出打印项次(p4);
}
其他的
{
口袋妖怪p4=新的口袋妖怪(口袋妖怪名称);
系统输出打印项次(p4);
}
System.out.println(“”);
newMove=readLine(“你想教“+pokemoname+”一个新动作吗?”);
如果(newMove.equalsIgnoreCase(“是”))
{
while(newMove.equalsIgnoreCase(“是”)&nummoves4<4)
{
moveName=readLine(“输入移动的名称:”);
moveDamage=readInt(“此移动造成多少伤害?”);
如果(numOfMoves4==0)
{
移动m13=新移动(移动名称,移动损坏);
p4.learnMove(m13);
System.out.println(口袋妖怪名称+“学习的”+m13);
}
else if(nummoves4==1)
{
移动m14=新移动(移动名称,移动损坏);
p4.learnMove(m14);
System.out.println(口袋妖怪名称+“学习的”+m14);
}
else if(nummoves4==2)
{
移动m15=新移动(移动名称,移动损坏);
p4.learnMove(m15);
System.out.println(口袋妖怪+“学习的”+m15);
}
else if(nummoves4==3)
{
移动m16=新移动(移动名称,移动损坏);
p4.learnMove(m16);
System.out.println(口袋妖怪名称+“学习的”+m16);
}
numOfMoves4++;
System.out.println(“”);
newMove=readLine(“你想教“+pokemoname+”一个新动作吗?”);
if(newMove.equalsIgnoreCase(“是”)&nummoves4<4)
{
}
else if(newMove.equalsIgnoreCase(“是”)&nummoves4>=4)
{
对不起,你不能再教“+口袋妖怪+”更多的动作了;
System.out.println(“”);
打破
}
其他的
{
System.out.println(口袋妖怪+“已经学会了他们所有的招式”);
System.out.println(“”);
}
}
}
其他的
{
System.out.println(口袋妖怪+“已经学会了他们所有的招式”);
System.out.println(“”);
}
//第二个培训师结束
//战斗
System.out.println(“您已经完成了口袋妖怪及其训练师的设置。\n准备好战斗了!”);
System.out.println(“”);
System.out.println(pt1+“带出”+p1+“去战斗!”);
System.out.println(pt2+“带出”+p2+“去战斗!”);
而((p1.getHealth()+p2.getHealth())==200 | |(p3.getHealth()+p4.getHealth())==200)
{

if(p1.getHealth()您的
Pokemon p1=…
仅限于其周围的
if(…){}
。请在更高的范围内声明它。

请在代码后添加调试错误,以便我们可以查看错误日志。(而不仅仅是说“java:56:error:not find symbol”)好的,我将更新我的帖子,将其包含在变量作用域上,因为这是问题的根源。我之所以将其包含在if语句中,是因为我有两个接受不同输入的构造函数。if语句检查用户是否输入了特定名称,以便它可以显示口袋妖怪的ASCII图像。@pcgamer2315132声明变量与初始化变量不同。请声明更高的值,在构造函数中初始化。@pcgamer2315132很好,如果要初始化变量,您可以使用这些值。但是您需要将
P
import java.util.ArrayList;
public class Move
{
    // Copy over your code for the Move class here
    private static final int MAX_DAMAGE = 25;
    private String name;
    private int damage;
    public static int numMoves;
    private ArrayList<Move> moveList = new ArrayList<Move>();

    public Move(String theName, int theDamage)
    {
        name = theName;
        if(theDamage <= MAX_DAMAGE)
        {
            damage = theDamage;
        }
    }

    public String getName()
    {
        return name;
    }

    public int getDamage()
    {
        return damage;
    }

    public static int getNumOfMoves()
    {
        return numMoves;
    }

    public ArrayList<Move> getList()
    {
        return moveList;
    }    

    public String toString()
    {
        return name + " (" + damage + " damage)";
    }    
    // Add an equals method so we can compare Moves against each other

    public boolean equals(Move other)
    {
        if(name.equals(other.getName()))
        {
            return true;
        }
        else
        {
            return false;
        }
    }     
}
import java.util.ArrayList;
public class PokemonTrainer
{
    // private constants
    private static final int MAX_POKEMON = 2;
    private ArrayList<Pokemon> pokemonList = new ArrayList<Pokemon>();
    private String name;
    private Pokemon p;
    private int numOfPokemon;

    // Write your PokemonTrainer class here
    public PokemonTrainer(String name)
    {
        this.name = name;
    }

    public boolean addPokemon(Pokemon p)
    {
        if(numOfPokemon < MAX_POKEMON)
        {
            pokemonList.add(p);
            numOfPokemon++;
            return true;
        }
        else
        {
            return false;
        }
    }

    public boolean hasLost()
    {
        int numOfPokemonThatLost = 0;
        for(Pokemon p : pokemonList)
        {
            if(p.hasFainted())
            {
                numOfPokemonThatLost++;
            }
        }
        if(numOfPokemonThatLost == numOfPokemon)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public Pokemon getNextPokemon()
    {
        int nextPokemon = 0;
        int numOfPokemonThatLost = 0;
        for(Pokemon p : pokemonList)
        {
            while(p.hasFainted() && nextPokemon < numOfPokemon)
            {
                nextPokemon++;
                numOfPokemonThatLost++;
                if(nextPokemon < numOfPokemon)
                {
                    p = pokemonList.get(nextPokemon);
                }
            }
        }
        if(numOfPokemonThatLost == numOfPokemon)
        {
            return null;
        }
        else
        {
            return pokemonList.get(nextPokemon);
        }
    }

    public String toString()
    {
        return name;
    }
}
public class PokemonSimulation extends ConsoleProgram
{
    private PokemonImages images = new PokemonImages();
    private String trainerName;
    private String trainerName2;
    private String pokemonImage;
    private String pokemonName;
    private String newMove;
    private String moveName;
    private int moveDamage;
    private int numOfMoves1;
    private int numOfMoves2;
    private int numOfMoves3;
    private int numOfMoves4;

    public void run()
    {
        System.out.println("Welcome the Pokemon Simulator!");
        System.out.println("");
        // First trainer
        System.out.println("Set up first Pokemon Trainer:");
        trainerName = readLine("Trainer, what is your name? ");
        PokemonTrainer pt1 = new PokemonTrainer(trainerName);
        System.out.println("Hello " + pt1 + "!");
        System.out.println("");
        System.out.println("Choose your first pokemon");
        pokemonName = readLine("Enter the name of your pokemon: ");
        System.out.println("You chose:");
        if(pokemonName.equalsIgnoreCase("Pikachu") || pokemonName.equalsIgnoreCase("Charmander") || pokemonName.equalsIgnoreCase("Bulbasaur") || pokemonName.equalsIgnoreCase("Squirtle"))
        {
            Pokemon p1 = new Pokemon(pokemonName, images.getPokemonImage(pokemonName));
            System.out.println(p1);
        }
        else
        {
            Pokemon p1 = new Pokemon(pokemonName);
            System.out.println(p1);
        }
        System.out.println("");
        newMove = readLine("Would you like to teach " + pokemonName +  " a new move? ");
        if(newMove.equalsIgnoreCase("yes"))
        {
            while(newMove.equalsIgnoreCase("yes") && numOfMoves1 < 4)
            {
                moveName = readLine("Enter the name of the move: ");
                moveDamage = readInt("How much damage does this move do? ");
                if(numOfMoves1 == 0)
                {
                    Move m1 = new Move(moveName, moveDamage);
                    p1.learnMove(m1);
                    System.out.println(pokemonName + " learned " + m1);
                }
                else if(numOfMoves1 == 1)
                {
                    Move m2 = new Move(moveName, moveDamage);
                    p1.learnMove(m2);
                    System.out.println(pokemonName + " learned " + m2);
                }
                else if(numOfMoves1 == 2)
                {
                    Move m3 = new Move(moveName, moveDamage);
                    p1.learnMove(m3);
                    System.out.println(pokemonName + " learned " + m3);
                }
                else if(numOfMoves1 == 3)
                {
                    Move m4 = new Move(moveName, moveDamage);
                    p1.learnMove(m4);
                    System.out.println(pokemonName + " learned " + m4);
                }
                numOfMoves1++;
                System.out.println("");
                newMove = readLine("Would you like to teach " + pokemonName +  " a new move? ");
                if(newMove.equalsIgnoreCase("yes") && numOfMoves1 < 4)
                {
                }
                else if(newMove.equalsIgnoreCase("yes") && numOfMoves1 >= 4)
                {
                    System.out.println("Sorry, you can't teach " + pokemonName + " anymore more moves.");
                    System.out.println("");
                    break;
                }
                else
                {
                    System.out.println(pokemonName + " has learned all of their moves");
                    System.out.println("");            
                }
            }
        }
        else
        {
            System.out.println(pokemonName + " has learned all of their moves");
            System.out.println("");
        }
        System.out.println("Choose your second pokemon");
        pokemonName = readLine("Enter the name of your pokemon: ");
        System.out.println("You chose:");
        if(pokemonName.equalsIgnoreCase("Pikachu") || pokemonName.equalsIgnoreCase("Charmander") || pokemonName.equalsIgnoreCase("Bulbasaur") || pokemonName.equalsIgnoreCase("Squirtle"))
        {
            Pokemon p2 = new Pokemon(pokemonName, images.getPokemonImage(pokemonName));
            System.out.println(p2);
        }
        else
        {
            Pokemon p2 = new Pokemon(pokemonName);
            System.out.println(p2);
        }
        System.out.println("");
        newMove = readLine("Would you like to teach " + pokemonName +  " a new move? ");
        if(newMove.equalsIgnoreCase("yes"))
        {
            while(newMove.equalsIgnoreCase("yes") && numOfMoves2 < 4)
            {

                moveName = readLine("Enter the name of the move: ");
                moveDamage = readInt("How much damage does this move do? ");
                if(numOfMoves2 == 0)
                {
                    Move m5 = new Move(moveName, moveDamage);
                    p2.learnMove(m5);
                    System.out.println(pokemonName + " learned " + m5);
                }
                else if(numOfMoves2 == 1)
                {
                    Move m6 = new Move(moveName, moveDamage);
                    p2.learnMove(m6);
                    System.out.println(pokemonName + " learned " + m6);
                }
                else if(numOfMoves2 == 2)
                {
                    Move m7 = new Move(moveName, moveDamage);
                    p2.learnMove(m7);
                    System.out.println(pokemonName + " learned " + m7);
                }
                else if(numOfMoves2 == 3)
                {
                    Move m8 = new Move(moveName, moveDamage);
                    p2.learnMove(m8);
                    System.out.println(pokemonName + " learned " + m8);
                }
                numOfMoves2++;
                System.out.println("");
                newMove = readLine("Would you like to teach " + pokemonName +  " a new move? ");
                if(newMove.equalsIgnoreCase("yes") && numOfMoves2 < 4)
                {
                }
                else if(newMove.equalsIgnoreCase("yes") && numOfMoves2 >= 4)
                {
                    System.out.println("Sorry, you can't teach " + pokemonName + " anymore more moves.");
                    System.out.println("");
                    break;
                }
                else
                {
                    System.out.println(pokemonName + " has learned all of their moves");
                    System.out.println("");            
                }
            }
        }
        else
        {
            System.out.println(pokemonName + " has learned all of their moves");
            System.out.println("");
        }
        // End of first trainer


        // Second trainer
        System.out.println("Set up second Pokemon Trainer:");
        trainerName = readLine("Trainer, what is your name? ");
        PokemonTrainer pt2 = new PokemonTrainer(trainerName);
        System.out.println("Hello " + pt2 + "!");
        System.out.println("");
        System.out.println("Choose your first pokemon");
        pokemonName = readLine("Enter the name of your pokemon: ");
        System.out.println("You chose:");
        if(pokemonName.equalsIgnoreCase("Pikachu") || pokemonName.equalsIgnoreCase("Charmander") || pokemonName.equalsIgnoreCase("Bulbasaur") || pokemonName.equalsIgnoreCase("Squirtle"))
        {
            Pokemon p3 = new Pokemon(pokemonName, images.getPokemonImage(pokemonName));
            System.out.println(p3);
        }
        else
        {
            Pokemon p3 = new Pokemon(pokemonName);
            System.out.println(p3);
        }
        System.out.println("");
        newMove = readLine("Would you like to teach " + pokemonName +  " a new move? ");
        if(newMove.equalsIgnoreCase("yes"))
        {
            while(newMove.equalsIgnoreCase("yes") && numOfMoves3 < 4)
            {
                moveName = readLine("Enter the name of the move: ");
                moveDamage = readInt("How much damage does this move do? ");
                if(numOfMoves3 == 0)
                {
                    Move m9 = new Move(moveName, moveDamage);
                    p3.learnMove(m9);
                    System.out.println(pokemonName + " learned " + m9);
                }
                else if(numOfMoves3 == 1)
                {
                    Move m10 = new Move(moveName, moveDamage);
                    p3.learnMove(m10);
                    System.out.println(pokemonName + " learned " + m10);
                }
                else if(numOfMoves3 == 2)
                {
                    Move m11 = new Move(moveName, moveDamage);
                    p3.learnMove(m11);
                    System.out.println(pokemonName + " learned " + m11);
                }
                else if(numOfMoves3 == 3)
                {
                    Move m12 = new Move(moveName, moveDamage);
                    p3.learnMove(m12);
                    System.out.println(pokemonName + " learned " + m12);
                }
                numOfMoves3++;
                System.out.println("");
                newMove = readLine("Would you like to teach " + pokemonName +  " a new move? ");
                if(newMove.equalsIgnoreCase("yes") && numOfMoves3 < 4)
                {
                }
                else if(newMove.equalsIgnoreCase("yes") && numOfMoves3 >= 4)
                {
                    System.out.println("Sorry, you can't teach " + pokemonName + " anymore more moves.");
                    System.out.println("");
                    break;
                }
                else
                {
                    System.out.println(pokemonName + " has learned all of their moves");
                    System.out.println("");            
                }
            }
        }
        else
        {
            System.out.println(pokemonName + " has learned all of their moves");
            System.out.println("");
        }
        System.out.println("Choose your second pokemon");
        pokemonName = readLine("Enter the name of your pokemon: ");
        System.out.println("You chose:");
        if(pokemonName.equalsIgnoreCase("Pikachu") || pokemonName.equalsIgnoreCase("Charmander") || pokemonName.equalsIgnoreCase("Bulbasaur") || pokemonName.equalsIgnoreCase("Squirtle"))
        {
            Pokemon p4 = new Pokemon(pokemonName, images.getPokemonImage(pokemonName));
            System.out.println(p4);
        }
        else
        {
            Pokemon p4 = new Pokemon(pokemonName);
            System.out.println(p4);
        }
        System.out.println("");
        newMove = readLine("Would you like to teach " + pokemonName +  " a new move? ");
        if(newMove.equalsIgnoreCase("yes"))
        {
            while(newMove.equalsIgnoreCase("yes") && numOfMoves4 < 4)
            {

                moveName = readLine("Enter the name of the move: ");
                moveDamage = readInt("How much damage does this move do? ");
                if(numOfMoves4 == 0)
                {
                    Move m13 = new Move(moveName, moveDamage);
                    p4.learnMove(m13);
                    System.out.println(pokemonName + " learned " + m13);
                }
                else if(numOfMoves4 == 1)
                {
                    Move m14 = new Move(moveName, moveDamage);
                    p4.learnMove(m14);
                    System.out.println(pokemonName + " learned " + m14);
                }
                else if(numOfMoves4 == 2)
                {
                    Move m15 = new Move(moveName, moveDamage);
                    p4.learnMove(m15);
                    System.out.println(pokemonName + " learned " + m15);
                }
                else if(numOfMoves4 == 3)
                {
                    Move m16 = new Move(moveName, moveDamage);
                    p4.learnMove(m16);
                    System.out.println(pokemonName + " learned " + m16);
                }
                numOfMoves4++;
                System.out.println("");
                newMove = readLine("Would you like to teach " + pokemonName +  " a new move? ");
                if(newMove.equalsIgnoreCase("yes") && numOfMoves4 < 4)
                {
                }
                else if(newMove.equalsIgnoreCase("yes") && numOfMoves4 >= 4)
                {
                    System.out.println("Sorry, you can't teach " + pokemonName + " anymore more moves.");
                    System.out.println("");
                    break;
                }
                else
                {
                    System.out.println(pokemonName + " has learned all of their moves");
                    System.out.println("");            
                }
            }
        }
        else
        {
            System.out.println(pokemonName + " has learned all of their moves");
            System.out.println("");
        }
        // End of second trainer
        //Battle
        System.out.println("You have finished setting up the Pokemon and their trainers. \nGet ready for battle!");
        System.out.println("");
        System.out.println(pt1 + " brings out " + p1 + " to battle!");
        System.out.println(pt2 + " brings out " + p2 + " to battle!");
        while((p1.getHealth() + p2.getHealth()) == 200 || (p3.getHealth() + p4.getHealth()) == 200)
        {
            if(p1.getHealth() <= 100)
            {
                System.out.println(p1.getMoves());
                String p1Attack = readLine(pt1 + ", what attack do you want " + p1 + " to use? ");

            }
        }
    }
}
PokemonSimulation.java:50: error: cannot find symbol
                    p1.learnMove(m1);
                    ^
  symbol:   variable p1
  location: class PokemonSimulation
PokemonSimulation.java:56: error: cannot find symbol
                    p1.learnMove(m2);
                    ^
  symbol:   variable p1
  location: class PokemonSimulation
PokemonSimulation.java:62: error: cannot find symbol
                    p1.learnMove(m3);
                    ^
  symbol:   variable p1
  location: class PokemonSimulation
PokemonSimulation.java:68: error: cannot find symbol
                    p1.learnMove(m4);
                    ^
  symbol:   variable p1
  location: class PokemonSimulation
PokemonSimulation.java:120: error: cannot find symbol
                    p2.learnMove(m5);
                    ^
  symbol:   variable p2
  location: class PokemonSimulation
PokemonSimulation.java:126: error: cannot find symbol
                    p2.learnMove(m6);
                    ^
  symbol:   variable p2
  location: class PokemonSimulation
PokemonSimulation.java:132: error: cannot find symbol
                    p2.learnMove(m7);
                    ^
  symbol:   variable p2
  location: class PokemonSimulation
PokemonSimulation.java:138: error: cannot find symbol
                    p2.learnMove(m8);
                    ^
  symbol:   variable p2
  location: class PokemonSimulation
PokemonSimulation.java:198: error: cannot find symbol
                    p3.learnMove(m9);
                    ^
  symbol:   variable p3
  location: class PokemonSimulation
PokemonSimulation.java:204: error: cannot find symbol
                    p3.learnMove(m10);
                    ^
  symbol:   variable p3
  location: class PokemonSimulation
PokemonSimulation.java:210: error: cannot find symbol
                    p3.learnMove(m11);
                    ^
  symbol:   variable p3
  location: class PokemonSimulation
PokemonSimulation.java:216: error: cannot find symbol
                    p3.learnMove(m12);
                    ^
  symbol:   variable p3
  location: class PokemonSimulation
PokemonSimulation.java:268: error: cannot find symbol
                    p4.learnMove(m13);
                    ^
  symbol:   variable p4
  location: class PokemonSimulation
PokemonSimulation.java:274: error: cannot find symbol
                    p4.learnMove(m14);
                    ^
  symbol:   variable p4
  location: class PokemonSimulation
PokemonSimulation.java:280: error: cannot find symbol
                    p4.learnMove(m15);
                    ^
  symbol:   variable p4
  location: class PokemonSimulation
PokemonSimulation.java:286: error: cannot find symbol
                    p4.learnMove(m16);
                    ^
  symbol:   variable p4
  location: class PokemonSimulation
PokemonSimulation.java:317: error: cannot find symbol
        System.out.println(pt1 + " brings out " + p1 + " to battle!");
                                                  ^
  symbol:   variable p1
  location: class PokemonSimulation
PokemonSimulation.java:318: error: cannot find symbol
        System.out.println(pt2 + " brings out " + p2 + " to battle!");
                                                  ^
  symbol:   variable p2
  location: class PokemonSimulation
PokemonSimulation.java:319: error: cannot find symbol
        while((p1.getHealth() + p2.getHealth()) == 200 || (p3.getHealth() + p4.getHealth()) == 200)
               ^
  symbol:   variable p1
  location: class PokemonSimulation
PokemonSimulation.java:319: error: cannot find symbol
        while((p1.getHealth() + p2.getHealth()) == 200 || (p3.getHealth() + p4.getHealth()) == 200)
                                ^
  symbol:   variable p2
  location: class PokemonSimulation
PokemonSimulation.java:319: error: cannot find symbol
        while((p1.getHealth() + p2.getHealth()) == 200 || (p3.getHealth() + p4.getHealth()) == 200)
                                                           ^
  symbol:   variable p3
  location: class PokemonSimulation
PokemonSimulation.java:319: error: cannot find symbol
        while((p1.getHealth() + p2.getHealth()) == 200 || (p3.getHealth() + p4.getHealth()) == 200)
                                                                            ^
  symbol:   variable p4
  location: class PokemonSimulation
PokemonSimulation.java:321: error: cannot find symbol
            if(p1.getHealth() <= 100)
               ^
  symbol:   variable p1
  location: class PokemonSimulation
PokemonSimulation.java:323: error: cannot find symbol
                System.out.println(p1.getMoves());
                                   ^
  symbol:   variable p1
  location: class PokemonSimulation
PokemonSimulation.java:324: error: cannot find symbol
                String p1Attack = readLine(pt1 + ", what attack do you want " + p1 + " to use? ");
                                                                                ^
  symbol:   variable p1
  location: class PokemonSimulation
25 errors