Environment to write code
You need a text editor to write your code. To compile your code, you need a compiler which will convert your code to machine understandable language, which will then machine understand.
Compiler
A program that translates instructions written in a high-level language into the equivalent machine language For this purpose, we use Integrated Development Environment (IDE) which is used to edit and compile the code. There are different IDEs available like:
- IntelliJ IDEA
- Eclipse
- NetBeans
- Visual Studio Code
- Oracle JDeveloper
- and more
These are all free and you can use any of these to run your code.
Note: Web based IDEs can also work but their functionality is limited.
You can download IntelliJ IDEA from their official website.
After setting up the environment, You can create a new project or open an existing one by selecting "File" ->"New Project" or "File" -> "Open" from the IntelliJ IDEA menu. Choose the appropriate project type and follow the prompts. After setting up the environment, you can write the code.
Your code should be error free so that it will execute without any error. We will understand this code in the next chapter.
Practice Exercises
Complete these exercises to reinforce your learning and earn XP