abstract class Demo {
public void show()
{
System.out.println("Hello I am In show method of Abstract
class");
}
}
class Sample extends Demo
{
public void show()
{ super.show();
System.out.println("Hello I am In Sample ");
}
}
public class Test
{
public static void main(String[] args) {
//I WANT TO CALL THE METHOD OF BASE CLASS IT IS POSSIBLE OR NOT
CAN WE USE SCOPE RESOLUTION OPERATOR TO CALL OR JAVA NOT
SUPPORTED THAT :: OPERATORE
}
}
Answer Posted / kuldeep
public class Test extends Demo {
public static void main(String[] args) {
Demo obj=new newQuestion();
obj.show();
}
//use this code in the main it will call the base method
Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
Is null keyword in java?
What is the use of inner class?
Explain the importance of finally over return statement?
What is the difference between break and continue statements?
how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)
Can we initialize the final blank variable?
List the features of java programming language.
Explain what access modifiers can be used for methods?
What is the size of a string in java?
What's the access scope of protected access specifier?
What is the synonym of framework?
What is tcp ip in java?
When is the finalize() called?
Explain about the select method with an example?
What is polymorphism and what are the types of it?