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
Do you know why doesn't the java library use a randomized version of quicksort?
How list contains works in java?
Can we define package statement after import statement in java?
What are invisible components?.
Can we rethrow the same exception from catch handler?
Difference between Linked list and Queue?
What is overriding in java?
What is void data type?
what is a green thread? : Java thread
How many bytes is a url?
How do you empty a list in java?
What is matcher in java?
What are the characteristics of Final,Finally and Finalize keywords.
Can a class be declared as protected?
What are the new features in java 8? Explain