Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static and abstract

 
sri rallapalli
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why is it not possible to declare a method both static and abstract?
thanks in advance,
sri.
 
Seenu Reddy
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sri rallapalli,

Static method can't override in sub class. But abstract methods ment to override.

Tip: Abstract method should not have any other non access modifier.

Thnanks,
Seenu
 
Liviu Carausu
Ranch Hand
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tip: Abstract method should not have any other non access modifier.


And not even all access modifiers : "private" is not allowed for the same reason: "abstract" is ment to be overriden , which is not possible for private methods
 
Philip Heller
author
Ranch Hand
Posts: 119
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes I've wanted an abstract synchronized method, to enforce synchronized behavior on all subclasses, but the compiler won't let me. I can imagine heavy-duty number crunchers wanting to create abstract strictfp methods, again to enforce behavior on all subclasses, but again it's illegal.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic