Submitted Questions

  • Managing Inheritance relationship between Classes and Sub-classes

    The central new idea in OOP is to allow classes to express similarities among objects that share some, but not all, of their structure and behavior. Such similarities can be expressed using inheritance and polymorphism. Explain how the special variables this and super help manage the inheritance relationship between classes and sub-classes. Do they (i.e., this and super) also help polymorphism? Explain....

  • Explain Object Construction in simple terms

    In Java, object types (i.e., classes) must be explicitly constructed for initialization. Explain object construction. Then, state the name of the mechanism for object destruction, and explain in simple terms how it works.

    Priya

    • Mar 16th, 2012

    In java Object destruction is automatically done by Garbage Collector which is provided y java run time system.

    when ever the scope of the object is over then the memory which is allocated for that object is released by the garbage collector.The programmer no need to do anything explicitly.

    Priya

    • Mar 15th, 2012

    We can construct the objects for a class by using the new keyword in java. Suppose take an Employee class and we can construct the objects for this class in the following way. Employee emp=new Employ...

  • Explain the mechanism to create an object.

    In Java, a class is a type, similar to the built-in types int and boolean. Declaring a variable does not create an object. Explain the mechanism to create an object.