• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Basics

 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As we say , after compilation of java code, bytecode is generated.

In this context, what is JVM and bytecode?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12196
35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java bytecode is a special language that the Java Virtual Machine (JVM) understands. The JVM is basically a program that knows how to read bytecode and talk to a specific operating system/platform. So, there is a JVM for windows XP, a JVM for linux, a JVM for Mac OS.10, etc.

You can give the exact same .class file (which is bytecode) to any JVM, and it will interpret it for the machine where it runs.

this is vastly different from something like C. You'd need to compile your C code for each platform, and make sure you sent the correct (set of) file(s) for that OS. That often lead to maintenance nightmares.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we say java is a secure language. Is this bytecode concept related to java security?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12196
35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, what makes java a secure language?
 
Henry Wong
author
Marshal
Pie
Posts: 21497
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kunal Lakhani wrote:So, what makes java a secure language?


No easy answer. Java is secure due to many components; from the byte code verifier, the class loaders, the security manager, and how many of the classes are designed and behave (immutability, etc.).

Henry
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15482
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kunal Lakhani wrote:As we say , after compilation of java code, bytecode is generated.

In this context, what is JVM and bytecode?

The following page in Oracle's Java Tutorials explains these basic principles: About the Java Technology.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic