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

What are java packages? What is the significance of packages?

799


Can a string be null?

763


define the terminology association.

901


Is vector thread safe in java?

798


How do you get length in java?

804


What is abstract class? Explain

812


What is the char data type?

796


What is java util hashmap?

757


Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

846


give an example for encapsulation?

796


What are the escape sequences in java?

782


What is javac in java?

783


What are the six ways to use this keyword?

858


How do you override a variable in java?

767


What happens if a constructor is declared private?

817