Java has lots of good features. Platform Independency is one of them. To implement Platform Independency Java uses the concept of Bytecode.
When Java source code(.java) compile, .class file produces. This .class file contains Bytecode. Java compiler does not take any kind of help of Operating System during generating .class. That's why Bytecode is a Platform Independent code.
Why it called Bytecode?
Let see one example first. Have you heard about Stenography? When in a Court, hearing goes, a person with a typewriter in a corner, type the whole hearing in real time. He uses some kind of symbols for long words and sentences and after hearing he decrypt the whole conversation this is Stenography.
Java compiler(javac) uses same technique to generate .class file. Java compiler converts one expression of our Source code into one symbol(Bytecode). The series of these symbols is the .class file.
Each symbol takes one byte of space on computer memory i.e. our one expression takes only one byte of space after conversion. That's why this code called Bytecode.
If you notice, Our Megabyte's source code file(.java) convert into of Kilobyte's(.class) after compilation. and It is just because of Bytecode.
When Java source code(.java) compile, .class file produces. This .class file contains Bytecode. Java compiler does not take any kind of help of Operating System during generating .class. That's why Bytecode is a Platform Independent code.
Why it called Bytecode?
Let see one example first. Have you heard about Stenography? When in a Court, hearing goes, a person with a typewriter in a corner, type the whole hearing in real time. He uses some kind of symbols for long words and sentences and after hearing he decrypt the whole conversation this is Stenography.
Java compiler(javac) uses same technique to generate .class file. Java compiler converts one expression of our Source code into one symbol(Bytecode). The series of these symbols is the .class file.
Each symbol takes one byte of space on computer memory i.e. our one expression takes only one byte of space after conversion. That's why this code called Bytecode.
If you notice, Our Megabyte's source code file(.java) convert into of Kilobyte's(.class) after compilation. and It is just because of Bytecode.
Comments
Post a Comment