This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt in abstract method  RSS feed

 
arulraj michaelraj
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one doubt in abstract method.

Why can't we apply static keyword for abstract method?

Can you please tell me the reason?
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what does "static" mean? What does "abstract" mean? On what type of methods does polymorphism work [clue]?
 
Jan Cumps
Bartender
Posts: 2632
17
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A static method belongs to the class that declares it.
It is not polymorphic, and needs an implementation.
When it needs an implementation, it can't be abstract.

It's explained here and here and there and stated by the Sun Java Language specification (section 8.4.3.1 and 8.4.3.2).

Regards, Jan
 
arulraj michaelraj
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks jan....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!