ArrayList+クラス+拡張for文

###Drink取り出し
分かりやすかったので。

```ArrayListClass.java
public static void main(String[] args) {
        var drinkList = new ArrayList<Drink>();

        //Drinkクラスを格納するArrayListに飲み物を追加
        Drink coffee = new Drink("コーヒー",1,130);
        drinkList.add(coffee);

        Drink water = new Drink("水",2,100);
        drinkList.add(water);

        //取り出すメソッドの呼び出し
        displayProduct(drinkList);
    }
    //メソッドの定義/ArrayListからDrinkクラスのフィールドを順に取り出す
    public static void displayProduct(ArrayList<Drink> drinkList){
        for(Drink drink : drinkList){
            System.out.println(drink.getNumber()+" . "+drink.getName()+drink.getPrice()+"円");
        }
    }
```

```Drink.java
public class Drink{
    private String name;
    private int number;
    private int price;

    public String getName() {
    return this.name;
    }
    public int getNumber() {
        return this.number;
    }
    public int getPrice() {
        return this.price;
    }

    public Drink(String name, int number, int price){
        this.name = name;
        this.number = number;
        this.price = price;
    }
}
```

一緒なんだけど自分好みみアレンジ

```OriginFighterArray.java
 List<Fighter> FighterList = new ArrayList<Fighter>();
        
        Fighter fighter1 = new Fighter("F15","USA","blue",90);
        Fighter fighter2 = new Fighter("F35","Japan","red",100);
        Fighter fighter3 = new Fighter("MIG","Russia","black",80);
        Fighter fighter4 = new Fighter("零","Japan","who",30);
        Fighter fighter5 = new Fighter("B31","iceLand","queen",48);
        FighterList.add(fighter1);
        FighterList.add(fighter2);
        FighterList.add(fighter3);
        FighterList.add(fighter4);
        FighterList.add(fighter5);

        for(Fighter fighter : FighterList){
            System.out.println(fighter.getName()+fighter.getCountry());
            System.out.println(fighter.getPrice()+"ドル"+fighter.getTagName());
        }

        System.out.println("fighterLogicMethod");
        var fl = new FighterLogic();
        fl.fighterLogic(FighterList);
    }
```

```FighterLogic.java
  public void fighterLogic(List<Fighter> FighterList){
        for(Fighter fighter : FighterList){
            System.out.println(fighter.getName()+fighter.getCountry());
            System.out.println(fighter.getPrice()+"ドル"+fighter.getTagName());
        }
    }
```

```Fighter.java
public class Fighter{
    private String name;
    private String country;
    private String tagName;
    private int price;

    public Fighter(){
    }
    public Fighter(String name, String country, String tagName, int price){
        this.name = name; this.country = country; this.tagName = tagName; this.price = price;
    }
    public void setName(String name){
        this.name = name;
    }
    public String getName(){
        return name;
    }
    public void setCountry(String country){
        this.country = country;
    }
    public String getCountry(){
        return country;
    }
    public void setTagName(String tagName){
        this.tagName = tagName;
    }
    public String getTagName(){
        return tagName;
    }
    public void setPrice(int price){
        this.price = price;
    }
    public int getPrice(){
        return price;
    }
```