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


Please Help Members By Posting Answers For Below Questions

Is null keyword in java?

524


What is the use of inner class?

543


Explain the importance of finally over return statement?

608


What is the difference between break and continue statements?

547


how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)

1905






Can we initialize the final blank variable?

582


List the features of java programming language.

561


Explain what access modifiers can be used for methods?

567


What is the size of a string in java?

547


What's the access scope of protected access specifier?

532


What is the synonym of framework?

558


What is tcp ip in java?

586


When is the finalize() called?

697


Explain about the select method with an example?

591


What is polymorphism and what are the types of it?

501