can we access the super class method using subclass object?
Answers were Sorted based on User's Feedback
Answer / azeem
Yes, you can acess the super class method by using the
subclass object because the super class methods are visible
to subclasses if not overriden. If the method is overriden,
then acess the super class method by using super.methodname
Is This Answer Correct ? | 17 Yes | 0 No |
Answer / muthukumari
yes, we can access the base class methods using a derived
class objects.
Is This Answer Correct ? | 9 Yes | 2 No |
If A is the super class and B is the subclass
inside subclass :
A a = new B();
a.methodA();
Here the methodA() should not be private.
Is This Answer Correct ? | 1 Yes | 0 No |
Does substring create a new object?
What is yielding and sleeping? how they different?
What is use of arraylist in java?
Why we should declare the variables as static and final in interfaces?
How many characters is 16 bytes?
What is the purpose of the finalize() method?
How can you make a class serializable in java?
What are the skills required for core java?
Does java allow default arguments?
Is 0 an even number?
where is .equals() method and how is it different from == operation <giving some confusing implementation> Is hashing related to these?
What is supplier in java?