Looking for the solution of IGNOU MCS 024 assignment 2018-19 question 2A - Explain use of super and final keywords in Java with the help of examples.
Objective
You will learn about the following in this guide / study material.
Answer of MCA MCS 024 question 2A - Explain use of super and final keywords in Java with the help of examples.
MCA MCS 024 Question 2A - Explain use of super and final keywords in Java with the help of examples. Solution
super keyword of Java programming language
In Java programming language, 'super' keyword is used for two purposes.
- To call the constructors of the immediate superclass.
- To access the members of immediate superclass.
When the constructor is defined in any subclass it needs to initialize its superclass variables. In Java using super() superclass constructor is called. super() must be the first executable statement in the subclass constructor. Parameters needed by superclass constructor are passed in super(parameter_list). The super keyword helps in conflict resolution in subclasses in the situation of "when members name in a superclass is same as members name in the subclass and the members ofthe superclass to be called in subclass".
So here was the solved IGNOU MCA MCS 024 assignment question 2(A) of 2018-2019.