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

Do you know why doesn't the java library use a randomized version of quicksort?

754


How list contains works in java?

746


Can we define package statement after import statement in java?

784


What are invisible components?.

1901


Can we rethrow the same exception from catch handler?

795


Difference between Linked list and Queue?

800


What is overriding in java?

763


What is void data type?

759


what is a green thread? : Java thread

799


How many bytes is a url?

764


How do you empty a list in java?

764


What is matcher in java?

733


What are the characteristics of Final,Finally and Finalize keywords.

941


Can a class be declared as protected?

753


What are the new features in java 8? Explain

743