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
What are java packages? What is the significance of packages?
Can a string be null?
define the terminology association.
Is vector thread safe in java?
How do you get length in java?
What is abstract class? Explain
What is the char data type?
What is java util hashmap?
Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?
give an example for encapsulation?
What are the escape sequences in java?
What is javac in java?
What are the six ways to use this keyword?
How do you override a variable in java?
What happens if a constructor is declared private?