deb
BAN USERIoC is a system which is capable of creating objects as of the requirment spcified to it and other program need to use the object without creating a new object.
PROS:
1 : Well memory, code, time, space management.
2 : Faster execution process.
3 : As of requirement duplication of object can removed.
CONS:
1 : Slow application start up process.
The major difference between abstract class and interface is in case of abstract class we can say that its a partially implemented structure where an interface is fully unimplemented structure. Now taking consideration of other facts like all the variables declared in an interface are public static in nature as well as if we write any class also by default public static. No method can have body part. And in case of abstract class we may or may not put the body part of the methods. If we do not put any body part in the abstract method the it should have public abstract.
- deb September 27, 2012public class Test{
public static void main(String[] args)
{
try{
//IF YOU PUT SYSTEM.EXIT(0) IN THE TRY BLOCK THEN IT WILL TERMINATE THE CODE WITHOUT EXECUTING THE FINALLY BLOCK. SO MAKE SURE THAT IT SYSTEM.EXIT(0) CONTAINS IN THE FINALLY BLOCK. SO THAT IT COULD GIVE YOU THE EXACT RESULT AS PER THE REQUIREMENT.
System.out.println("Hi");
}finally{
System.out.println("Good Bye");
System.exit(0);
}
}
- deb April 22, 2015