Monday, 29 August 2011

what is an interface? java interview questions ...

Ans:

  • An interface is a named collection of method declarations and constant declarations. 
  • here we only declare the methods not a implementation. 
  • it's implemented by a class using implements keyword.

syntax:

        interface interface name{

           //declaration of methods and constants

         }

        class class name implements{

       

            //implementation codes

        }

No comments: