Professional Documents
Culture Documents
AOOP Midterm Act 1
AOOP Midterm Act 1
2 – CS3
Midterms Act 1
Code:
import java.util.ArrayList;
import java.util.Scanner;
class Pokemon {
this.name = name;
this.type = type;
this.ability = ability;
return name;
return type;
return ability;
@Override
return "Pokemon{" + "name='" + name + '\'' + ", type='" + type + '\'' + ", ability='" + ability + '\''+'}';
}
public class pokeDex{
static {
if (pokemon.getName().equalsIgnoreCase(name)) {
return pokemon;
return null;
System.out.println("Starter Pokemons:");
System.out.println(pokemon);
}
printPokedex();
if (foundPokemon != null) {
} else {
scanner.close();