Good afternoon,
When I compile this code:
public class HelloWorld {
public static void main(String[] args) throws Exception {
AnimalFactory factory = new AnimalFactory();
System.out.println("C:\\springboot\\Third\\src\\test\\resources\\fileTest.txt");
Path path = Paths.get("C:\\springboot\\Third\\src\\test\\resources\\fileTest.txt");
String read = Files.readAllLines(path).get(0);
System.out.println(read);
Animal anm = factory.create(AnimalType.DONKEY);
System.out.println(anm.makeSound());
System.out.println("I am here!!");
System.out.println(1/0);
System.out.println(CurrencyType.KWD.getDecimalPoints());
System.out.println(CurrencyType.USD.getIsoCurrencyCode());
}
}
I got Hello ! Hello ! Hello ! Exception in thread "main"
Why I got this? and how can I solve it?
Thanks in advance