• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

An abstract method can NOT be declared static, synchronized,

 
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 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.
reply
    Bookmark Topic Watch Topic
  • New Topic