• Post Reply Bookmark Topic Watch Topic
  • New Topic

how every methods in interfaces are public abstract by default  RSS feed

 
S.Reddisekhar Reddy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how every methods in interfaces are public abstract by default
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because it is a specification, whole world have to see this interface before going for a contract.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S.Reddisekhar Reddy wrote:how every methods in interfaces are public abstract by default


Because the JLS defines it that way and compilers are written to implement the JLS.
 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
think about the alternatives. what good would a private abstract method be?

as for abstract, you you want non-abstract methods you use abstract class instead of interface
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!