Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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

native method

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, folks:
can native method be declared abstract? or is it implicitly abstract?
You don't have to declare a class with native method abstract.
Now you declare the native method abstract and meanwhile declare the class as abstract, and seems there is no compiler error.
Any clarification?
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Abstract methods are designed to be implemented in subclasses. Native methods are coded in languages other than Java (ussually to gain better performance or to access specific hardware) and are not expected to be provided in subclasses.
You cannot declare native method as abstract.
If you try to compile

you will get error message:
Abstract method can�t be native
For native methods you can use the following keywords only:
any access modifier (private including)
static
synchronized
final
 
reply
    Bookmark Topic Watch Topic
  • New Topic