Answers for "CodeHS java 9.5.6"

0

CodeHS java 9.5.6

//CodeHS AP Computer Science A Java, 9.5.6: Pies
//DO NOT COPY AND PASTE, YOUR TEACHER CAN SEE YOUR EDIT HISTORY.

//PieTester.java

import java.util.ArrayList;

public class PieTester
{
    public static void main(String[] args)
    {
        ArrayList<Pie> pies = new ArrayList<Pie>();
        Pie applPie = new ApplePie(7);
        Pie pumpPie = new PumpkinPie(7, true);
        Pie pie = new Pie("blueberry", 7);
        
        pies.add(applPie);
        pies.add(pumpPie);
        pies.add(pie);
        
        for(int i = 0; i < pies.size(); i++){
            System.out.print("Pie: ");
            System.out.println(pies.get(i).getType());
        }
    }
}
Posted by: Guest on April-27-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language