wood burning stoves*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Key Words Invocation  in Java" Watch "Key Words Invocation  in Java" New topic
Author

Key Words Invocation in Java

Shahid Shaikh
Greenhorn

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 .

Shahid.
Pushkaraj Thorat
Greenhorn

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:
http://en.wikipedia.org/wiki/List_of_Java_keywords
http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#7143

Regards, Pushkaraj
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Key Words Invocation in Java
 
Similar Threads
Boone 1.1 Mock # 34
Select maximum two rows of a table with ctrl key in swt/Jface
problems in subpackage and imports
return,continue,break keywords
How to import classes in a subpackage from another sub-package?