Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

API and JVM  RSS feed

 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im reading this article to try and familiarise myself with the Java technology.

http://java.sun.com/docs/books/tutorial/getStarted/intro/definition.html

In the article i came across this statement "The API and Java Virtual Machine insulate the program from the underlying hardware."

I can see how the JVM insulates teh program from the underlying hardware but can someone please clarify to me how the API does the same thing? (As per statement above)


Thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37230
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API has you deal with higher order concepts like File, Socket, etc. As a developer, you don't care how the OS implement these concepts. For example, the file separator is different on Windows and UNIX. The file class provides a constant you can use to avoid hard coding the one that applies to your platform. There are also a number of system properties like path separators that serve similar functions.
 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that makes sense. Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!