• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Key Words Invocation in Java

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic