When you write a program, you might think that it's easy for the computer to understand what you are writing and that it understands all programming languages. Instead, your computer cannot understand any programming language except 1: binary. Binary, also called machine code, is a programming language so simple that it only uses 1s and 0s representing on and off. Converting a program written in Java into binary code involves several steps and processes, but understanding how it works can help you grasp important concepts later on.
Here's how it works:
You might have noticed that I have mentioned the word compiler many times throughout this course. What does it mean? A compiler translates your programming file into binary. The compiler has a counterpart called an interpreter. Although both the compiler and the interpreter accomplish the same task of turning a programming file into binary, they both do it in different ways, making both useful in different scenarios.
________________________________________________________________________________
Examples of languages that use a compiler:
Examples of languages that use an interpreter:
________________________________________________________________________________
How a compiler translates regular code into binary:
How an Interpreter translates regular code into binary:
________________________________________________________________________________
Attributes of Compilers:
Attributes of Interpreters:
________________________________________________________________________________
What to use when?
We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.