diff between Virtual mathod and abstract method?

Answer Posted / pawan kumar

Virtual methods have an implementation and provide the derived classes with the option of overriding it. Abstract methods do not provide an implementation and force the derived classes to override the method. So, abstract methods have no actual code in them, and subclasses HAVE TO override the method.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1458


What are the data types in oop?

608


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1986


If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

944


What is encapsulation with real life example?

572






Can an interface inherit a class?

561


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

1639


What is the renewal class?

2167


What is polymorphism in oops with example?

532


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1621


How do you define social class?

600


Why interface is used?

553


What is new keyword in oops?

593


What is abstraction in oops with example?

776


What is constructor overloading in oop?

607