public class Triangle { public double calcArea(double base, double height) { if(base<=0) { throw new NumberFormatException("Hibaaaa"); // throw new NullPointerException("Hiba"); } return base * height / 2; } }