Why does the code work the same way?
public static void main(String[] args) throws Throwable{
for(int i = 1; i <= 50000; i++){
Cat cat = new Cat();
Dog dog = new Dog();
}
}
and
public static void main(String[] args) {
for(int i = 1; i <= 50000; i++){
Cat cat = new Cat();
Dog dog = new Dog();
}
}
Need or not
throws Throwable