Bytecode helps to solve Java's portability and security problem. It is a highly optimized set of instructions designed to be executed by Java run-time system,which is called as Java Virtual Machine (JVM).JVM is an interpreter for bytecode,it helps to solve major problems associated with downloading programs over the Internet .
Let us see portability and security in details:-
1. Portability
Translating Java programs into bytecode helps makes it much easier to run in a wide variety of environments,only JVM needs to be implemented for each platform . Once the runtime package is present on the given system then any Java program can run on that system. Though JVM differ from platform to platform ,all interpret the same Java bytecode.If a Java program could have compiled to native code,then different versions of same program would have been present which could have create a lot of problem to portable programs so,the interpretation of bytecode is the easiest way .
2.Security
The interpreted Java program also helps to make it secure.Because the execution of every Java program is under the control of JVM,the JVM can contain program and prevent it from generating side effects outside the system.When a program is interpreted it generally runs substantially slow than it would run if compiled to executable code. However,with Java the difference between the two is not so great . The use of bytecode enables the Java runtime system to execute programs much faster than you might expect.
When Just In Time(JIT) compiler is a part of the JVM,it compiles bytecode into executable code in real time,on a piece-by-piece ,demand basis.It is important to understand that it is not possible to compile an entire Java program into executable code all at once ,because Java programs perform various run-time checks that can be done only at run time.Instead JIT compiles the code as it is needed during execution and the increase the performance of Java
- Footer SlideUp – Works with All CMSes and Autoresponders
- Read From File Using StreamReader Class
- Why Email Marketing Works?
- BucketExplorer Review
Enter your Name and Email below to subscribe and start 1 month free course now.








