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
}
}
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sathiya
We cant call the base class since we cant create object for
abstract class(base class is a abstract class).
And java does not support the scope resoultion operator to
call a class.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / kapilpahujamca
I TELL THEM IT IS NOT POSSIBLE TO CALL THE BASE METHOD AND I
ALSO REPLY THAT JAVA DOES NOT SUPPORT :: OPEARTOR IT IS
IMMPOSSIBLE
| Is This Answer Correct ? | 1 Yes | 1 No |
What is the use of 'super' keyword inside a constructor?
0 Answers Flextronics, Thomson Reuters, Virtusa,
Explain about strings in java?
What is difference between pointer and reference?
What is difference between null and void?
Which is bigger float or double java?
Can we declare an interface as final?
What is an example of a boolean?
What does indexof return in java?
Does java vector allow null?
Can a class inherit the constructors of its superclass?
Can a constructor call the constructor of parent class?
What is object cloning in Java?
0 Answers SwanSoft Technologies,