what is the differance b/w checked and unchecked exceptions.
If a piece of code potentialy throws a checked exception, the compiler forces you to surround it with a try/catch or to declare that your method throws this exception. It does not if it is an unchecked exception (=> a method never has to declare that it can throw an unchecked exception)
how the JVM identifies these as checked and unchecked
Any exception inheriting from RuntimeException in unckeched, all the others are checked.
Note: unchecked exceptions must be considered as bugs: i.e. something that is not
planned as opposed to checked exception which represent an unexpected state of things (like a connection closed by a 3rd party).
It is considered a bad practice to throw an unchecked exception: use something that the client class must catch deal with.
It is considered a bad practice to catch an unchecked exception: suppress the root cause in development time rather than dealing with it in runtime: remmember that (in a perfect world) unchecked exceptions must considered as bugs.