I'm coming from doing a lot of programming in python, and I'm having a
problem understanding how exceptions work in java. I looked at the
tuturial provided by Sun, and it explained that you catch exceptions in
java pretty much like you do in python:
try{
..
}
catch NameOfException{
do something
}
But then why do you need to put a "throws Exception" in, as in this code
right here, which I am copying form a book?
public static void main(String[] args) throws Exception{
\\my code checks to make sure there is only on argument
int len = args.length;
if (len != 1){
System.err.println("Please provide one argument");
System.exit(1);
}
new Pipeline().run(args[0]);
}