more debugs

Wednesday, December 7, 2011

Some Definations

What is Serialization?

- The process of  writing the state of an object to a byte system is called serialization, also, it is used to save the program to persistent storage area, like a file and easily restore using deserialization process.

 Why do we need finalize() method when Garbage Collection is there?

-Some time an object (which is lost there object reference) is holding some JAVA resources like file handle, Character font, need to free from the resource before that object is collected by JVM or say garbage collection.

Why finally methods in exceptions?
- The finally method will be executed after a try or catch execution, and mainly used to free up resources. Any code that must be execute before a method returns is put in a finally block.

                               try {
                                     // block of code to monitor for errors
                                    }
                              catch(Exception exObject)
                                             {
                                              // exception handler for Exception Type1
                                              }
                                finally 
                                           {
                                              // block of code to be executed before method returns
                                         }

Method Overloading ?
   -   Operator Overloading is a specific case of polymorphism in which some or all of opertors like    +,=,or == have different implementations depending on the types of their arguments.

        Function Overloading or method overloading allows to creation of several methods with the same name which differ from each other in terms of the type of input and the type of the output of the function(not available in JAVA).

Method overloading is usually associated with statically-typed programming languages which enforce type checking in functions call.


Method Overriding ?
   - In overriding, a method in a super class is overridden the subclass. The method in the subclass will have the same signature as that of the super class, Since the method in the subclass has the same signature and name as the method of its superclass, it is termed as overriding.
                         


No comments:

Post a Comment