Click here and discuss.

Click here and discuss.

by Md Assaduzzaman -
Number of replies: 8
1. Why we use super keyword in java?
2.  What are the some advantages of inheritance..?
In reply to Md Assaduzzaman

Re: Click here and discuss.

by Sadid Ahmed -
1. Ans: The super keyword in Java is a reference variable that is used to refer parent class objects. The super() in Java is a reference variable that is used to refer parent class constructors. super can be used to call parent class' variables and methods. super() can be used to call parent class' constructors only.
2. Ans: The advantages of inheritance-

Inheritance promotes reusability. When a class inherits or derives another class, it can access all the functionality of inherited class.
Re usability enhanced reliability. The base class code will be already tested and debugged.
As the existing code is reused, it leads to less development and maintenance costs.
Inheritance makes the sub classes follow a standard interface.
Inheritance helps to reduce code redundancy and supports code extensibility.
Inheritance facilitates creation of class libraries.
The main advantages of inheritance are code re usability and readability. When child class inherits the properties and functionality of parent class, we need not to write the same code again in child class. This makes it easier to reuse the code, makes us write the less code and the code becomes much more readable.
In reply to Md Assaduzzaman

Re: Click here and discuss.

by Md. Inzamamul Haque -
1. The super keyword refers to superclass objects. It is used to call superclass methods, and to access the superclass constructor. The most common use of the super keyword is to eliminate the confusion between super classes and subclasses that have methods with the same name.

2. Some advantages of inheritance:
a. Inheritance promotes reusability.
b. Reusability enhanced reliability. The base class code will be already tested and debugged.
c. As the existing code is reused, it leads to less development and maintenance costs.
d. Inheritance makes the sub classes follow a standard interface.
e. Inheritance helps to reduce code redundancy and supports code extensibility.
f. Inheritance facilitates creation of class libraries.
In reply to Md Assaduzzaman

Re: Click here and discuss.

by Mahmudur Rahman -
Answer to the question number 1:
*Access to parent class data members when both parents and children are members with the same name.
*Clearly call the parent's class narang and parametric constructor.
*To give parents access to the class method when the child class has abolished this method.
Answer to the question number 2:
*The most frequent use of inheritance is to obtain a class using existing classes, which facilitates reuse the code.
*The derived classes add to the characteristics of the base class to produce more dominant objects.
*The same base class can be used by multiple derivative classes in the classification.
In reply to Md Assaduzzaman

Re: Click here and discuss.

by Akash das -
1. The super keyword refers to superclass (parent) objects. It is used to call superclass methods, and to access the superclass constructor. The most common use of the super keyword is to eliminate the confusion between superclasses and subclasses that have methods with the same name.

2. These are some main Advantages of using inheritance:
*Application development time is less.
*Application take less memory.
*Application execution time is less.
*Application performance is enhance (improved).
*Redundancy (repetition) of the code is reduced or minimized so that we get consistence results and less storage cost.
In reply to Md Assaduzzaman

Re: Click here and discuss.

by Sayeada Ummal Fatema -
1.The super keyword in Java is a reference variable that is used to refer to the immediate parent class object. Whenever you create the instance of a subclass, an instance of the parent class is created implicitly which is referred to by the super reference variable.
super can be used to refer to the immediate parent class instance variable.
super can be used to invoke the immediate parent class method.
super() can be used to invoke the immediate parent class constructor.

2.Advantages of Inheritance :
- It allows the code to be reused as many times as needed.
- The base class once defined and once it is compiled, need not be reworked.
- Saves time and effort as the main code need not be written again.
- Code reusability
- Saves time in program development.
In reply to Md Assaduzzaman

Re: Click here and discuss.

by Md Hasan Al Rashid -
1.The super keyword in Java is a reference variable that is used to refer to the immediate parent class object. Whenever you create the instance of a subclass, an instance of the parent class is created implicitly which is referred to by the super reference variable.
super can be used to refer to the immediate parent class instance variable.
super can be used to invoke the immediate parent class method.
super() can be used to invoke the immediate parent class constructor.

2.Advantages of Inheritance :
- It allows the code to be reused as many times as needed.
- The base class once defined and once it is compiled, need not be reworked.
- Saves time and effort as the main code need not be written again.
- Code reusability
- Saves time in program development.
In reply to Md Assaduzzaman

Re: Click here and discuss.

by Kamruzzaman Kowshik -
1.The super keyword in Java is a reference variable that is used to refer to the immediate parent class object. Whenever you create the instance of a subclass, an instance of the parent class is created implicitly which is referred to by the super reference variable.
super can be used to refer to the immediate parent class instance variable.
super can be used to invoke the immediate parent class method.
super() can be used to invoke the immediate parent class constructor.

2. Some advantages of inheritance:
a. Inheritance promotes reusability.
b. Reusability enhanced reliability. The base class code will be already tested and debugged.
c. As the existing code is reused, it leads to less development and maintenance costs.
d. Inheritance makes the sub classes follow a standard interface.
e. Inheritance helps to reduce code redundancy and supports code extensibility.
f. Inheritance facilitates creation of class libraries.
In reply to Md Assaduzzaman

Re: Click here and discuss.

by Mufty _ -
1)
The super catchphrase alludes to superclass (parent) objects. It is utilized to call superclass strategies, and to get to the superclass constructor.

2)The fundamental focal points of legacy are code reusability and coherence. At the point when kid class acquires the properties and usefulness of parent class, we need not to compose a similar code again in kid class. This makes it simpler to reuse the code, causes us to compose the less code and the code turns out to be significantly more lucid.