You are on page 1of 6

IBRAHIM ABDUL-SHAKUR SUHUMAAYA

4211210069

Develop a PowerPoint on why Java is


able to use both compilers and
interpreters at the same time.
WHAT IS JAVA?
Java is a high-level, class-based, object-oriented programming language that
is designed to have as few implementation dependencies as possible . It is a
general-purpose programming language intended to let programmers write
once, run anywhere (WORA).

 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

Interpreters are used to execute code written in high-level programming


languages. They are different from compilers which translate source code into
machine code that can be executed by a computer .
Why Java is able to use both compilers
and interpreters at the same time
Java is able to use both compilers and interpreters because the source code is
first compiled into bytecode by the Java compiler. This bytecode is then
interpreted by the Java Virtual Machine (JVM), which is usually a software-
based interpreter .

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.

You might also like