« Home | Voice Mail Technology - Unified Messaging - The 8t... » | Download Free PSP Games » | Diablo 2 - The Best RPG of All Time » | The Best Safe Sportsbook Keeps Falsely Predicting ... » | The Good and Bad Impacts of Online Gaming » | Latest Game Consoles - A Complete Entertainment-Pack » | Biodiesel and Technology-Working Together For a Br... » | So You Want to Be a Game Designer? » | Play Pokemon Online » | Warhammer Age of Reckoning Online - The Classic Ga... » 

Sunday, October 26, 2008 

Java Interface Overview

Interface: Interfaces can be used to implement the Inheritance relationship between the non-related classes that do not belongs to the same hierarchy, i.e. any Class and any where in hierarchy. Using Interface, you can specify what a class must do but not how it does.

  • A class can implement more than one Interface.
  • An Interface can extend one or more interfaces, by using the keyword extends.
  • All the data members in the interface are public, static and Final by default.
  • An Interface method can have only Public, default and Abstract modifiers.
  • An Interface is loaded in memory only when it is needed for the first time.
  • A Class, which implements an Interface, needs to provide the implementation of all the methods in that Interface.
  • If the Implementation for all the methods declared in the Interface are not provided , the class itself has to declare abstract, other wise the Class will not compile.
  • If a class Implements two interface and both the Intfs have identical method declaration, it is totally valid.
  • If a class implements tow interfaces both have identical method name and argument list, but different return types, the code will not compile.
  • An Interface can't be instantiated. Intf Are designed to support dynamic method resolution at run time.
  • An interface can not be native, static, synchronize, final, protected or private.
  • The Interface fields can't be Private or Protected.
  • A Transient variables and Volatile variables can not be members ofInterface.
  • The extends keyword should not used after the Implements keyword, the Extends must always come before the Implements keyword.
  • A top level Interface can not be declared as static or final.
  • If an Interface species an exception list for a method, then theclass implementing the interface need not declare the method withthe exception list.
  • If an Interface can't specify an exception list for a method, the class can't throw an exception.
  • If an Interface does not specify the exception list for a method, he class can not throw any exception list.
  • Further information can be found at:

http://www.testingcorner.net

http://www.abapprogramming.net

In this Sept. 2, 2006 file photo, provided by the Center for Whale Research, a female orca, or killer whale, travels with her offspring in waters around the San Juan Islands in Washington State. Seven killer whales are missing in from nearby Puget Sound and presumed dead in what could be the biggest decline among the sound's orcas in nearly a decade, scientists at the research center who carefully track the endangered animals said Friday, Oct. 24, 2008. (AP Photo/Courtesy The Center for Whale Reseach)AP - Seven Puget Sound killer whales are missing and presumed dead in what could be the biggest decline among the sound's orcas in nearly a decade, say scientists who carefully track the endangered animals.

About me

  • I'm boxcvd
  • From
My profile

Archives

Powered by Blogger
and Blogger Templates