Professional Documents
Culture Documents
Ibrahim Abdul-Shakur Suhumaaya (4211210069)
Ibrahim Abdul-Shakur Suhumaaya (4211210069)
4211210069
This means that compiled Java code can run on all platforms that support
Java without the need for recompilation Java is used to develop a wide range
of applications, from mobile apps to desktop software and games
WHAT IS A COMPILER?
A compiler is a program that translates the instructions of a high-level programming
language into machine-level language that can be executed by a computer. The input to a
compiler is called a source code and the output is called an object code .
Compilers are used to convert human-readable code into machine-readable code. They are
essential tools for software development and are used to create a wide range of
applications, from simple scripts to complex software systems
There are many compilers available for different programming languages, and some of
them can be accessed online. For example, Programiz offers an online C compiler that
allows you to write C code and run it online Similarly, OnlineGDB provides an online C
compiler that allows you to compile and execute C programs online
WHAT IS AN INTERPRETER?
An interpreter is a program that directly executes instructions written in a
programming or scripting language, without requiring them to be compiled
into a machine language program. The input to an interpreter is called source
code and the output is the result of executing the source code
The bytecode generated by the Java compiler can be executed on any platform
that has a JVM installed, without the need for recompilation
it makes Java portable. Java programs can be written once and run on any
platform that supports Java .The Java compiler converts the entire source code
into a machine-code file or any intermediate code, which is then executed.
SUMMARY
In summary, Java uses both compilers and interpreters to achieve
platform independence and portability. The Java compiler converts
the source code into bytecode, which is then interpreted by the
JVM. This allows Java programs to be written once and run on any
platform that supports Java.