This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes static and abstract Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "static and abstract" Watch "static and abstract" New topic
Author

static and abstract

sri rallapalli
Ranch Hand

Joined: Mar 15, 2005
Posts: 88
why is it not possible to declare a method both static and abstract?
thanks in advance,
sri.
Seenu Reddy
Ranch Hand

Joined: Apr 03, 2002
Posts: 108
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


Thanks,<br />Seenu<br />SCJP1.4,SCBCD1.3,Next-->SCWCD1.4
Liviu Carausu
Ranch Hand

Joined: Oct 07, 2004
Posts: 157

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


Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer.
Philip Heller
author
Ranch Hand

Joined: Oct 24, 2000
Posts: 119
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.


Consultant to SCJP team.<br />Co-designer of SCJD exam.<br />Co-author of "Complete Java 2 Certification Study Guide".<br />Author of "Ground-Up Java".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: static and abstract
 
Similar Threads
abstract static method
Mughal Q4.26
Static Methods in an Interface
Java Basics
why can't abstract class have abstract static method?