You are on page 1of 2

7/14/13

An abstract method can NOT be declared static, synchronized, (SCJP forum at JavaRanch)

File APIs for Java Developers Manipulate DOC, XLS, PPT, PDF and many others from your application. http://aspose.com/file-tools

A friendly place for programming greenhorns!

Big Moose Saloon


Search

Java FAQ

Recent Topics

Register / Login

JavaRanch Java Forums Certification Programmer Certification (SCJP/OCPJP)

Author

An abstract method can NOT be declared static, synchronized,


posted 10/20/2001 5:53 PM

leena rane Ranch Hand Joined: Aug 13, 2001 Posts: 280

An abstract method can NOT be declared static, synchronized, native(!!!),strictfp...... Why not synchronized.....? ----------also An interface method can NOT be static, synchronized,............ why not static or synchronized? --------------Thanx in advance

Jose Botella Ranch Hand Joined: Jul 03, 2001 Posts: 2120

posted 10/20/2001 8:42 PM

From JLS 9.4 "Note that a method declared in an interface must not be declared static, or a compile-time error occurs, because static methods cannot be abstract. Note that a method declared in an interface must not be declared strictfp or
1/2

https://www.coderanch.com/t/226454/java-programmer-SCJP/certification/abstract-method-declared-static-synchronized

7/14/13

An abstract method can NOT be declared static, synchronized, (SCJP forum at JavaRanch)

native or synchronized , or a compile-time error occurs, because those keywords describe implementation properties rather than interface properties. However, a method declared in an interface may be implemented by a method that is declared strictfp or native or synchronized in a class that implements the interface." I guess an abstract method can't be static, native, private, final or native because of all them would prevent it from being overriden in a subclass.
SC JP2. Please Indent your code using UBB C ode

I agree. Here's the link: http://aspose.com/file-tools

subject: An abstract method can NOT be declared static, synchronized,

Similar Threads Native Methods Modifiers why interface methods cannot be declared as native or synchronized? Native Methods abstract method and synchronized clause
All times above are in your local time zone & format.T he current ranch time (not your local time) is Jul 14, 2013 09:09:23 .

Contact Us | Powered by JForum |

C opyright 1998-2013 Paul W he aton

https://www.coderanch.com/t/226454/java-programmer-SCJP/certification/abstract-method-declared-static-synchronized

2/2

You might also like