< Table of Contents | Chapter 2 >

What is Java?

Java is a general-purpose programming language that can be used to write almost any type of software you can imagine such as desktop and web applications, specialised tools and software, mobile apps, video games, and more.

Java is a high-level language meaning that it is further from the native language of the computer and closer to human language. In contrast, a low-level language is closer to the hardware but further from human language. This is a sliding scale and all languages sit somewhere on the scale. For example, C can be considered a low high-level language. Python is a higher-level language than Java. Assembly is a low-level language. Machine code is very low-level (machine code the computer can execute directly). Whatever language you use, it will always be converted down to machine code for it to be executed.

To us, lower-level languages are more verbose and gritty whereas higher-level are more succinct and friendly. To the computer, it is the other way around; the lower the language, the easier it is to compute. But this is inconsequential since we can achieve 10x more in 10% of the time using high-level languages like Java. Don’t think this makes high-level languages slow, either. Computers today are extraordinarily fast and are more than capable of translating high-level languages down to machine code even while the application is running. Languages that predominantly do this—such as Python—are called interpreted languages. Java, on the other hand, is pre-compiled (pre-translated) into a language close the hardware anyway, called bytecode. The fact is, most applications you use every day are very likely written in one high-level language or another.

What is a Program?

A program is a collection of files, fundamentally. You write code (instructions) in these files and the computer executes (follows) them. Every time you use an application and click a button, this causes code in one or more files to run and carry out some work. In a text editor, for example, if you were to select some text and click the italics icon (I ), this causes certain code to run that is responsible for turning the text italic.

The files and code are known as source files and source code, respectively, because they are the source of the program. In order for the program to actually start running, the source code often must go through several translation steps until it’s in the form the computer can understand i.e. machine code. However, you don’t have to know how this process works in order to write powerful and complex programs because it’s all taken care of by Java and the OS (Operating System). You just need to know how to write the source code in the language of your choice (Java in our case).

Leave a Reply

Your email address will not be published. Required fields are marked *