• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

interface

 
vanya khanduri
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can a method in an interface be declared static??? why???
 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They can be but they implicitly static
 
Stephen Joseph
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Methods in the Interface are abstract implicitly and they have to be implemented in some class which will be accesed by objects
(instances)
By making the methods static we mean that it belongs to a class and not any instances and so I think that both abstract and static cant be used together as it will defy the purpose of the interfaces(to be implemented by classes)

Thank you
Steven
 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i made a mistake interface mmethods cannot be static becaue object must implement them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic