What is the difference between an Interface and an Abstract class ?
Correct Answer
1Main difference is methods of a Java interface are implicitly abstract and cannot have implementations A Java abstract class can have instance methods that implements a default behavior 2Variables declared in a Java interface is by default final An abstract class may contain non-final variables 3Members of a Java interface are public by default A Java abstract class can have the usual flavors of class members like private, protected, etc 4Java interface should be implemented using keyword ?implements?; A Java abstract class should be extended using keyword ?extends? 5An interface can extend another Java interface only, an abstract class can extend another Java class and implement multiple Java interfaces 6A Java class can implement multiple interfaces but it can extend only one abstract class 7Interface is absolutely abstract and cannot be instantiated; A Java abstract class also cannot be instantiated, but can be invoked if a main() exists 8In comparison with java abstract classes, java interfaces are slow as it requires extra indirection
More questions
1. Who is responsible for maintaining the Accounts receivable in an organization?
Correct Answer: A commercial bank is a type of bank that provides services such as accepting deposits, making business loans, and offering basic investment products Commercial bank can also refer to a bank or a division of a bank that mostly deals with deposits and loans from corporations or large businesses, as opposed to individual members of the public
Correct Answer: PL/SQL tables are scalar arrays that can be referenced by a binary digit They can be used to store values for later queries and calculations