aspose file tools*
The moose likes Beginning Java and the fly likes Java Basics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Basics" Watch "Java Basics" New topic
Author

Java Basics

Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 618
As we say , after compilation of java code, bytecode is generated.

In this context, what is JVM and bytecode?


kunal
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10905
    
  12

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 618
we say java is a secure language. Is this bytecode concept related to java security?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10905
    
  12

no.
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 618
So, what makes java a secure language?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18101
    
  39

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13864
    
  10

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.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Basics
 
Similar Threads
Java source files security
byte code
JAVA Virtual Machine
Class Loaders (theory)
Bytecode