diff between Abstract class Interfaces?
Answers were Sorted based on User's Feedback
Answer / anu mehra
abstract classes contain
1)abstract as well as non abstract method
2) to inherit we use extends keyword
Interface
1) all methods are abstract ,public and static
2) all variables are public , static and final
3) to inherit we use implements keyword
4) interface can extend another interface
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / pramod kumar sharma
abstract class contains the at list one abstract methods and abstract methods contain the only declaration but no definition.
interface contain all methods abstract methods only.
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / dhanya
Any class with one or more abstract method is called an abstract class.It can have data attributes,concrete methods and constructors.Abstract class can differ the implementation
by declaring the method to be abstract,and a Java interface declares only the contract and no implementation.All methods declared in interface are public and abstract.All attributes are public,static and final.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / latha
abstract class contains the abstract methods. these methods
contain the only declaration but no definition.
interface is the class which extends the many interfaces.
and the class implements the many interfaces
| Is This Answer Correct ? | 1 Yes | 4 No |
#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; a.x = 22; int c = a.x; int *b = new int; cout << c; return 0; } option: No output 0 22 -(11) Will not compile
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
What does oop mean in snapchat?
What is virtual Function.
how to swap the variables without using temp and operators
Write a c++ program to display pass and fail for three student using static member function
for example A,B,C,D are class all the 4 class contain one method who() but the method who() implementaion is differnet among each class. the relation among the 4 class are A is base class and is inherited by B and C.and from this two B and C where D is inherited. the question is i want to display the output who() method in all the classes(A,B,C,D)the output of who() method is diferrent amond all the class(A,B,C,D) ------A------ virtuval who(print a) override | | who(print b) B C override who(print c) | | -------D------ override who(print d)
Write a program in c++ to read two floating point numbers and find their sum and average.
What is multilevel inheritance explain with example?
Why do we need polymorphism in c#?
What is for loop and its syntax?
why constructor cannt be declar virtually? why destructor cannt be overloaded?