package lect1_coding; import utils.NotPossibleException; /** * @overview * A program that demonstrate how to use {@link Tank} * * @author namhv */ public class TankTestApp { /** * The main method * @effects
* create a {@link Tank} t object * display an error message if failed **/ public static void main(String[] args) { // create a new Tank Tank t1 = null; try { t1 = new Tank(10, 5, 3, 10); // display the tank object System.out.println("Created: " + t1); } catch (NotPossibleException e) { System.err.println("-> Failed to create tank"); e.printStackTrace(); } // create a new Tank Tank t2 = null; try { t2 = new Tank(10, -1, 3, 10); // display the tank object System.out.println("Created: " + t2); } catch (NotPossibleException e) { System.err.println("-> Failed to create tank"); e.printStackTrace(); } } }