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

Is array serializable java?

701


What is an example of procedure?

698


How garbage collection is done in java?

748


When arithmeticexception is thrown?

768


What is are packages?

756


How do you delete a list in java?

711


What is == mean?

733


What is bytecode in java ?

823


Difference between Linked list and Queue?

780


What is double checked locking in singleton?

797


What is the difference between the final method and abstract method?

756


What is an accessor?

1306


Can we create an object of private class?

727


Explain what access modifiers can be used for variables?

778


Differentiate between nested and inner class in java.

754