can we access the super class method using subclass object?

Answer Posted / naveen kumar t

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does java enable high performance?

686


What is the original name of java?

540


Define a java class.

803


Where to store local variables?

579


What is difference between path and classpath?

556






Why volatile is used in java?

528


How use .contains in java?

617


Explain garbage collection in java?

541


How do you access command-line arguments within the code?

571


Can a class have more than one object?

524


What is procedure overloading?

1797


What are the object and class classes used for?

552


Explain java code for recursive solution's base case?

570


Can we increase array size dynamically in java?

504


What is anagram in java?

514