Professional Documents
Culture Documents
An Abstract Method Can NOT Be Declared Static, Synchronized, (SCJP Forum at JavaRanch)
An Abstract Method Can NOT Be Declared Static, Synchronized, (SCJP Forum at JavaRanch)
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
Java FAQ
Recent Topics
Register / Login
Author
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
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
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 .
https://www.coderanch.com/t/226454/java-programmer-SCJP/certification/abstract-method-declared-static-synchronized
2/2