1.can i use super keyword in normal class(not inheritance)
to call any method?if so how can i call particular variable?
2.In the inheritance how can i access the particular
variable from the base class(it containing 5 variables)
using super keyword?



1.can i use super keyword in normal class(not inheritance) to call any method?if so how can i call ..

Answer / Sunil Kumar Rana

1. In a normal class, you cannot use the super keyword to call methods from the superclass because there is no inheritance relationship.
2. When using inheritance, accessing variables from the base class can be done by using the super keyword followed by the variable name within the subclass constructor or any method.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Java Related AllOther Interview Questions

What is the content of the Java 2 security policy file?

1 Answers  


What do I need to install netbeans?

1 Answers  


Explain the Sequence Diagram?

2 Answers   HCL,


Is jdk an ide?

1 Answers  


In my project i need to use either JSF or Struts.Here i need some clarification about them and which IDE is better for JSF development? Please post your valuble answers ASP!

4 Answers   Infosys,


Iam working as a Project Lead in a s/w comp.The follwing question was asked in HCL interview. What about the schedule slippage? If the developer has taken more time than the specified time. How do you adjust the time? From where do you allocate that extra time for the developer?

2 Answers   HCL, Logesys,


What is stateless in java?

1 Answers  


Is java secure? : java security

1 Answers  


What does persist mean in java?

1 Answers  


What is tuple2?

1 Answers  


Why is lambda expression used?

1 Answers  


How do I install eclipse?

1 Answers  


Categories