Package com.theryanclark.op

Source Code of com.theryanclark.op.Main

package com.theryanclark.op;

import com.theryanclark.op.core.Oil;
import com.theryanclark.op.core.Press;
import com.theryanclark.op.input.BlackOlive;
import com.theryanclark.op.input.GreenOlive;
import com.theryanclark.op.input.Olive;

public class Main {
  public static void main(String[] args) {
    /* Give me olives, a press and a bucket; */
    Press press = new Press(new Olive[] {
      new GreenOlive(), new BlackOlive(),
      new GreenOlive(), new BlackOlive(),
      new GreenOlive()
    }); // add five olives
   
    press.add_olives(new Olive[] {
      new BlackOlive(), new GreenOlive(),
      new BlackOlive(), new GreenOlive(),
      new BlackOlive()
    }); // add five more olives
   
    /* Run the machine and fill up our bucket; */
    Oil bucket = press.crush();
   
    /* Total amount of how much Olive Oil we have; */
    System.out.println( "You have " + bucket.get_amount() + " units of oil." );
  }
}
TOP

Related Classes of com.theryanclark.op.Main

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.