It's not a secret anymore!
The moose likes Java in General and the fly likes Key Words Invocation  in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Key Words Invocation  in Java" Watch "Key Words Invocation  in Java" New topic

Key Words Invocation in Java

Shahid Shaikh

Joined: Mar 02, 2009
Posts: 7
Hello i was just thinking of how the Keywords in java are Implemented . Can any one help me in understanding the fundamentals behind that

To clear my doubt i have an example

Here in above example "for" loop is the key word used . There is mechanism which invokes the for loop . how would be tho code @ the back end which initializes increments and checks for every execution . This is a case for "for loop " similarly there are other keywords like "while" "do while" .

Please help me out in Understanding the same .. Thanks in advance .

Pushkaraj Thorat

Joined: Jun 07, 2007
Posts: 7
As per my knowledge, there are 2 parts the answer you need.

1. Java Compiler(javac)
If you have studied compilers, you should be familiar with the code generation mechanism. The code generated here, is Byte-Code, Bytecode are instructions which has, menomonic and opcode alike we have in x86 programming language. It is RISC instruction set.
For each construct like for, while, do-while, etc you have skeleton of code construct ready, it is just filled in and written to your .class file.

Now this .class file can be read by any VIRTUAL Machine which accepts bytecodes. In our case we use JVM.

2. JVM(java)
Now, here is the thing which runs your byte code. Alike we have processor to run machine instructions, we have JVM to run bytecode. But JVM is not a hardware entity, its a program in execution.
JVM has its register set, databus etc. implemented. These things are either implemented in CODE or it relies on capabilities of underlying hardware.

If you are interested in finding out more details you can see the following links:

Regards, Pushkaraj
I agree. Here's the link:
subject: Key Words Invocation in Java
It's not a secret anymore!