Showing posts with label Read More. Show all posts
Showing posts with label Read More. Show all posts

Tuesday, August 24, 2010

Topic: JAVA INTERVIEW QUESTIONS-2?

Java Interview Questions-2?

Q:What is the difference between an Interface and an Abstract class?
A:   An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.
.       

Topic: JAVA INTERVIEW QUESTIONS?

Java Interview Questions

What is a virtual function in C++?

Simply put, the virtual keyword enables a function to be 'virtual' which then gives possibility for that function to be overridden (redefined) in one or more descendant classes. It is a good feature since the specific function to call is determined at run-time. In other words, a virtual function allows derived classes to replace the implementation provided by the base class.