Sunday, November 21, 2010

Interface

What is Interface?
Answer : An interface is a description of a set of methods that conforming implementing classes must have.
Note:
    1. You can’t mark an interface as final.
    2. Interface variables must be static.
    3. An Interface cannot extend anything but another interfaces.
    4. \
    Question : Can we declare a Instance Variable in an Interface ?
    Answer : NO , All variables in Interface is public static final implicitly and Explicitly.
    Example :  
                      public Interface myInterface  
                     {
                                int i = 50; /* looks like a instance variable but not */
                     }
          The actual Implementation of above code is 
                      public Interface myInterface
                    {
                             public static final int i = 50;
                    }
    Look into Following wonderful link : 



    • Question :

    No comments:

    AWS certification question

    AWS AWS Hi! this is for questions related to AWS questions. EC2 instances EC2 storage types cold HDD : 1. Defines performance in terms...