Java is the first widely used programming language with language level support for concurrency (threads) and synchronization (monitors), which considers being a big advantage
In Java training there are five important philosophical goals for the language.
Java is a language which should be easy to use, and it should also be able to borrow important elements from older programming languages.
It should always use an object oriented approach.
Any programs which are created in Java should be able to run on multiple operating systems
It should never be limited to a single OS.
It should also be designed to work with computer networks, and it should also be able to remotely initiate code. These are the five goals of Java.
When getting Java training, it is important to understand exceptions. Exceptions are uncanny situations that can destroy the normal behavior of a program.
Exception Handling is always been an area that has many implication in overall functioning of any Java based application or system. As we, Java Developers already know that there is a specific Exception hierarchy or framework is already in place in JDK, in order to proceed with proper handling of exceptions in Java based application.
Just to re-state this basic exception hierarchy, I am going to write something about it. There is a Super class Throwable that has error and exception as sub class. Errors need not be handled by program code, and it should be triggering a system shut down. But in case of exceptions, there can be two possibilities; one is runtime and one in coding time. Sometimes these are called as unchecked and checked exceptions. Checked exception can be handled in the same method/class where it occurred or can be thrown back to the main program to place exception handling generic code at one place in the Java application. But Unchecked exception or runtime exceptions should be automatically coming to the main program without need for throws clause or to be thrown, if the method raising this exception is not explicitly catching this runtime exception, which should be avoided, as in my opinion it could be like hiding the exception without the main program even knowing that a runtime exception has occurred.
Exception Handling strategies can be as simple as putting try..catch..finally or try..finally or try..catch..catch..finally..catch..finally or sometimes could be nested as well. But with little bit of logical thinking and better exception handling strategy, it is possible to tame exceptions, be it checked or unchecked and output is better code with properly handled exceptions.
No comments:
Post a Comment