• 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
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

MARQUES exam 2, q 5

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 5)
Why might you define a method as native?
1) To get to access hardware that Java does not know about
2) To define a new data type such as an unsigned integer
3) To write optimised code for performance in a language such as C/C++
4) To overcome the limitation of the private scope of a method
//DONT HAVE A CLUE WHY 1 IS TRUE I THOUGHT NATIVE WAS ONLY USED FOR NATIVE LANGUAGES AND DID NOT HAVE ANY RELEVANCE TO HARDWARE ???
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sarim,
Java is platform independant and hence if it want's to access say a printer throu printers driver then it needs to call that native program generally written in C.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java have no means for direct hardware acces, your Java code is pretty much limeted by the API exposed through the JDK. If you want to access arbitrary harware devices from Java you need to use some sort of library written in C/C++ or any other language and complied into native platform binary code and call it over JNI.
regards,
VG.
 
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic