Inside the Java Virtual Machine

Bill Venners

Mentioned 4

A manual on the Java 1.2 virtual machine. This new edition contains a new chapter providing a tutorial on using native methods with the JNI (Java Native Interface) specification. The CD-ROM contains source code examples from the book, interactive illustrations, Java Development Kit, and a resources Web site.

More on

Mentioned in questions and answers.

Is there any reason why Java booleans take only true or false why not 1 or 0 also?

On a related note: the java compiler uses int to represent boolean since JVM has a limited support for the boolean type.See Section 3.3.4 The boolean type.

In JVM, the integer zero represents false, and any non-zero integer represents true (Source : Inside Java Virtual Machine by Bill Venners)

Knowing how Java works in initializing objects and how it bind methods and fields to an object , abstract , final methods to an object and some other issues take a lot of time to guess myself , and i needed to ensure that every guess i made was correct by asking here and there . I need some recommendations to read or watch (books-tutorials-articles-videos) , thanks in advance

I'm currently waiting for Beginning Java Objects: From Concepts to Code to arrive on my doorstep. I hope it will be what you are looking for. I am purchasing this book because I too need help understanding objects in the Java language. I think it would be best to understand how objects are used in the language, then continue studying the language itself.

After that book, I'll go onto (or read at the same time) Beginning Java 2 by Ivor Horton. Both books received really good reviews on Amazon, so hopefully they are good for both you and I.

You need to go back to basics and read a good Java introduction (just skip the parts you know), as these are realy basic Java questions you have. Most popular text is:

Head First Java (2nd edition)

Or for a more down to earth advanced text:

Core Java, Volume I - Fundementals (8th edition)

What I think you are getting at is how java really works under the hood. To that end, I think you would do well to understand byte-code, what java is interpreted to, and what the byte-code instructions mean to the jvm. By understanding what all of the Java language features convert to on a more raw level, you'll walk away with a much deeper understanding that, honestly, few people I've met have on the subject.

To this end, I'm going to suggest something that is a bit of a deviation from the norm and tell you to look at this book, Expert .NET 2.0 IL Assembler . That book is on the .NET intermediate language, the analogue to java's byte-code. I'm suggesting that simply because no good book exists on this for Java byte-code, and this is book gave me the understanding to easily tackle Java.

if you want to understand how java works i would recommend Inside Java Virtual Machine by Bill Veeners

I am reading the book Inside the Java 2 Virtual Machine and I can't understand what this means:

The Java Virtual Machine is stack-based rather than register-based because its instructions take their operands from the operand stack rather than from registers. Instructions can also take operands from other places, such as immediately following the opcode (the byte representing the instruction) in the bytecode stream, or from the constant pool.

Can anyone help me with the part:

Instructions can also take operands from other places, such as immediately following the opcode

, perhaps with an example?

For example, there's an iinc instruction which adds a constant value to the local variable like this:

iinc 1, 8

This means "add 8 to the local variable #1". The constant 8 is directly written in the bytecode, following the iinc instruction code and constant 1: 0x84 0x01 0x08.

What are some good sources to learn about Java Virtual Machine for newbies?

The following books are good to learn about JVM.

Inside Java Virtual Machine

Java Performance


Realated tags