Subscribe to Zinmag Tribune
Subscribe to Zinmag Tribune
Subscribe to Zinmag Tribune by mail
6:05 AM Posted by techgeek
Object-Orientation Section






What is class?

Class is blue print for objects; Class is collection of objects; Class gives the general structure for objects.


What is object?

Object is an instance of class. Object is real world entity which has state, identity and behavior.


What is encapsulation?

Encapsulation is packing of data with their methods


What is abstraction?


Abstraction is the process of identification of essential features of objects


What is data hiding?

Implementation details of methods are hidden from the user


What is hierarchy?

Ordering of classes (or inheritance)


What is inheritance?

Extending an existing class is called inheritance. Extracting the features of super class


Why inheritance is important?

Reusability is achieved through inheritance



Which types of inheritances are available in Java?

Simple, Hierarchical and Multilevel


Can we achieve multiple inheritances in Java?

With the help of interfaces we can achieve


What is interface?

Interface is collection of final variables and abstract methods

(We need not give final and abstract keywords and By default they are public methods)


What is the difference between class and interface?

Class contains implemented methods, but interface contains non-implemented methods



What is polymorphism?

Multiple (poly) forms (morphs)

Same instance can respond different manners is called polymorphism


Can we achieve run time polymorphism in Java?

Yes, also called as dynamic polymorphism. Possible by dynamic method dispatch


What is dynamic method dispatch?

When you assign object of sub class for the super class instance, similar methods of super class are hidden


What is overloading?

Same method name can be used with different type and number of arguments (in same class)



What is overriding?

Same method name, similar arguments and same number of arguments can be
defined in super class and sub class. Sub class methods override the super class methods.


What is the difference between overloading and overriding?

Overloading related to same class and overriding related sub-super class

Compile time polymorphism achieved through overloading, run time polymorphism achieved through overriding



You can leave a response, or trackback from your own site.

0 Response to " "

Post a Comment

featured-video