Results 1 to 3 of 3
  1. #1
    cbalu is offline Member
    Join Date
    Nov 2007
    Posts
    3
    Rep Power
    0

    Default Why methods in an interface cannot be static?

    Why is this so?

  2. #2
    asifsolkar is offline Member
    Join Date
    Dec 2007
    Location
    India
    Posts
    14
    Rep Power
    0

    Default

    methods in interface are abstract by nature which means the class that implements this interface has to write the code for it hence it is not static

  3. #3
    staykovmarin is offline Senior Member
    Join Date
    Nov 2007
    Location
    Newport, WA
    Posts
    141
    Rep Power
    0

    Default

    Why WOULD you want them to be static? You can only have one static method in one place, having an interface, pretty much means that it is DESIGNED to be implemented, therefore, to be used by more than one class. If its overridden, and its static, static would looses its meaning, since more than one class are going to contain a single method, that does different things, but its implemented from the same interface.

    What in the world made you think this was an Advanced topic?

Similar Threads

  1. Newbie question about Static methods
    By SCS17 in forum New To Java
    Replies: 9
    Last Post: 02-06-2008, 08:03 AM
  2. Static methods - not working
    By Echilon in forum New To Java
    Replies: 2
    Last Post: 12-21-2007, 01:31 PM
  3. Mocking static methods of class
    By Kat in forum New To Java
    Replies: 3
    Last Post: 11-08-2007, 12:24 AM
  4. Static methods
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-04-2007, 05:56 PM
  5. significance of static variables and methods
    By imran_khan in forum New To Java
    Replies: 4
    Last Post: 08-02-2007, 09:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •