What is interface and its use?

Answer Posted / harish

Interface is nothing but an unimplemented class. It
contains the method signatures. The method access
specifier may be abstract. The sub class should implement
all the methods, which are defined in the Interface. If
you don?t implement any method that class should be an
abstract class. Using Interface, It enforces the sub
classes to implement the same. So that, you can create an
instance of any sub class.

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why singleton pattern is better than creating singleton class with static instance?

538


Is java a super set of javascript?

587


What is the difference between Error, defect,fault, failure and mistake?

660


How do you get the length of a string in java?

522


How are the elements of a gridbaglayout organized in java programming?

520






How do you sort a list in java?

581


Is ++ operator thread-safe in java?

636


How do you invoke a method?

539


What does arrays sort do in java?

541


How to check if a list is sorted in java?

590


Why multiple inheritance is not supported by java?

514


What is numeric function?

542


What are the main concepts of oops in java?

593


What is array command?

561


What is the concatenation operator in java?

580