Welcome to the world of Java! In this tutorial, we’ll start from the very Java basics and cover all the essential concepts that you need to know as a beginner.
Java is a high-level, object-oriented, distributed, secure, multi-threaded, and portable programming language. Java is a general-purpose programming language intended to let Java developers Write Once and Run Anywhere (WORA). Java was first released in 1995. It was created by James Gosling and his team at Sun Microsystems (now owned by Oracle Corporation).
WORA means that the compiled Java code(Java bytecode) can run on many platforms that support Java without the need to recompile the Java source code. This allows Java to be cross-platform and platform-independent.
Java is designed to be platform-independent, meaning that Java programs written can run on any platform (such as Windows, Mac, or Linux) without needing to be recompiled. This is achieved through the use of the Java Virtual Machine (JVM), which translates Java code into bytecode that can be executed on any platform.
Before you can start writing Java programs, you need to have Java installed on your computer. You can download the latest version of Java from the official website.
First Java Application
Once you have Java installed, you need to set up your environment variables to point to the Java installation directory. This will allow you to run Java programs from the command line also.
Let’s start by writing a simple “Hello, World!” program in Java.
In Java, a variable is a named container that stores a value. You can declare a variable in Java by specifying its data type (such as int or double) and a name for the variable.
Java Access Modifiers
Class and Object
Setters and Getters
Java Testing Tools
JDBC stands for Java Database Connectivity. JDBC API defines classes and interfaces that allow Java applications to interact with databases. In the following tutorials, we will learn to execute SQL statements from Java programs using JDBC API.
The basic steps to execute SQL statement with JDBC API are:
- Configure Java development environment. ( JDK Install, IDE setup, etc)
- Create a Java project and class
- Download and Install JDBC Driver. Set up a classpath or build a path for the driver.
- Load suitable JDBC Driver
- Establish a database connection
- Create an SQL statement to execute
- Execute the SQL statement
- Process the query ResultSet
- Close the database connection
Java Database Connectivity API
More information on Java: