Lesson 1
What is Java?
A beginner-friendly introduction to Java, where it is used, and how to install and run a first program.
Lesson content
What is Java?
Java is a general-purpose, class-based, object-oriented programming language used for building desktop, web, mobile, enterprise, and big data applications.
Java follows the principle of WORA (Write Once, Run Anywhere), allowing programs to run on different platforms without modification.
Origin of Java
Java was developed by James Gosling and was initially released by Sun Microsystems before being acquired by Oracle Corporation.
- Platform-independent
- Object-oriented
- Secure
- Reliable
- Fast
- Scalable
Definition list
- Java: A general-purpose, object-oriented programming language used for developing software applications.
- WORA (Write Once, Run Anywhere): A Java feature that allows programs to run on multiple platforms without recompilation.
- JDK (Java Development Kit): A software package containing tools required to develop and run Java applications.
- JVM (Java Virtual Machine): A virtual environment that executes Java bytecode on different operating systems.
- Compiler: A tool that converts Java source code into bytecode.
Applications of Java
Desktop applications
Java provides powerful APIs such as Swing, AWT, and JavaFX for building graphical user interface applications on Windows, Linux, and macOS.
- Text editors
- Media players
- Business management software
Mobile applications
Java is one of the most popular languages for Android application development with strong Android SDK support and compatibility with Kotlin.
- Spotify
Game development
Java is used in Android, online, and 3D game development with support for powerful 3D engines.
Web applications
Java powers dynamic web applications through technologies such as Servlets, JSP, Spring Framework, and Hibernate.
Enterprise software development
Java is highly preferred for enterprise-level applications because of its security, reliability, and scalability.
- Banking
- Insurance
- Retail
- Healthcare
Big data technologies
Many big data technologies are built using Java thanks to its performance and scalability.
- Hadoop
- HDFS
Embedded systems and IoT
Java is used in smart cards, IoT devices, embedded systems, and utility devices because of its portability and libraries.
Java download steps in Windows
- Visit the Oracle Java Downloads page.
- Click Products, select Java, then click Download Java.
- Scroll down and choose the Windows download option.
- Download the JDK installer (typically x64 Installer).
- Verify the installer file is in your Downloads folder.
Java installation steps in Windows
- Open the downloaded JDK installer file.
- Run the installer (double-click or Run as Administrator).
- Click Next to start the setup wizard.
- Choose an installation location and click Next.
- Wait for installation to finish and click Close.
How to write your first Java program
- Open Notepad or another text editor.
- Type the Java program shown below.
- Save the file with the class name.
- Because the class name is Main, save it as Main.java.
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}How to compile and run a Java program
- Open Command Prompt in the folder where Main.java is saved.
- Compile the program with javac Main.java.
- Run the program with java Main.
javac Main.java
java MainOutput
Hello WorldWhy learn Java?
- Easy to learn with beginner-friendly syntax.
- Platform independent across operating systems.
- Large community support and documentation.
- High demand in industry for enterprise systems.
FAQ
Who is the father of Java?
James Gosling developed Java at Sun Microsystems.
What does WORA mean in Java?
WORA stands for Write Once, Run Anywhere.
What is the difference between JDK and JVM?
JDK is the development toolkit, while JVM executes Java bytecode.
Meta description
Learn what Java is, its features, applications, installation steps, and how to run your first Java program with this beginner-friendly guide.
Where Java is used
Java in real-world development
Desktop applications
Build cross-platform GUIs with Swing, AWT, or JavaFX for tools like editors and business software.
Mobile applications
Java is a core language for Android development with strong SDK support and Kotlin compatibility.
Games
Java supports Android, online, and 3D games with engines that handle graphics and interaction.
Web applications
Servlets, JSP, Spring, and Hibernate power secure, scalable web applications.
Enterprise software development
Enterprise systems in banking, insurance, and healthcare rely on Java for security and scalability.
Big data technologies
Big data platforms like Hadoop and HDFS use Java for performance at scale.
Embedded systems
Smart cards and IoT devices use Java because it is portable and library-rich.