Java Tutorial
Last Updated : 28 Mar 2026
Our Core Java programming tutorial is designed for students and working professionals. Java is an object-oriented, class-based, concurrent, secured and general-purpose computer programming language. It is a widely used robust technology.
What is Java?
Java is a programming language and a platform. Java is a high-level, robust, object-oriented and secure programming language.
Java was developed by Sun Microsystems (which is now a subsidiary of Oracle) in the year 1995. James Gosling is known as the father of Java. Before Java, its name was Oak. Since Oak was already a registered company, so James Gosling and his team changed the name from Oak to Java.
Platform: Any hardware or software environment in which a program runs is known as a platform. Since Java has a runtime environment (JRE) and API, it is called a platform.
Java Example
Let's have a quick look at the Java programming example. A detailed description of the Hello World! example is available on the next page.
Getting Started
Before diving into coding, we will need to set up your development environment. Java development typically requires the Java Development Kit (JDK), which includes the Java compiler and other essential tools. You can download the JDK from the official Oracle website and follow the installation instructions for your operating system.
Once we have the JDK installed, you can use a text editor or an Integrated Development Environment (IDE) like IntelliJ IDEA, Eclipse, or NetBeans to write and run your Java code. IDEs provide features such as code completion, debugging, and project management, making them invaluable tools for developers.
Application
According to Sun Microsystems, 3 billion devices run Java. There are various devices where Java is currently used. Some of them are as follows:
- Desktop Applications such as Acrobat Reader, media player, antivirus, etc.
- Web Applications such as irctc.co.in, tpointtech.com, etc.
- Enterprise Applications such as banking applications.
- Mobile
- Embedded System
- Smart Card
- Robotics
- Games, etc.
Types of Java Applications
There are the following 4-types of applications that can be created using Java programming:
1) Standalone Application
Standalone applications are also known as desktop applications or window-based applications. These are traditional software that we need to install on every machine. Examples of standalone applications are Media players, antivirus, etc. AWT and Swing are used in Java for creating standalone applications.
2) Web Application
An application that runs on the server side and creates a dynamic page is called a web application. Currently, Servlet, JSP, Struts, Spring, Hibernate, JSF, etc. technologies are used for creating web applications in Java.
3) Enterprise Application
An application that is distributed in nature, such as banking applications, etc. is called an enterprise application. It has advantages like high-level security, load balancing, and clustering. In Java, EJB is used for creating enterprise applications.
4) Mobile Application
An application that is created for mobile devices is called a mobile application. Currently, Android and Java ME are used for creating mobile applications.
Java Platforms / Editions
There are four platforms or editions of Java:
1) Java SE (Java Standard Edition)
It is a Java programming platform. It includes Java programming APIs such as java.lang, java.io, java.net, java.util, java.sql, java.math etc. It includes core topics like OOPs, String, Regex, Exception, Inner classes, Multithreading, I/O Stream, Networking, AWT, Swing, Reflection, Collection, etc.
2) Java EE (Java Enterprise Edition)
It is an enterprise platform that is mainly used to develop web and enterprise applications. It is built on top of the Java SE platform. It includes topics like Servlet, JSP, Web Services, EJB, JPA, etc.
3) Java ME (Java Micro Edition)
It is a micro platform that is dedicated to mobile applications.
4) JavaFX
It is used to develop rich Internet applications. It uses a lightweight user interface API.
Prerequisite
To learn Java, you must have a basic knowledge of C/C++ programming language.
Audience
Our Java programming tutorial is designed to help beginners and professionals.
Problem
We assure you that you will not find any problems in this Java tutorial. However, if there is any mistake, please post the problem in the contact form.
Java Tutorial MCQs
1) In respect of Java, select the correct one.
- Java is a high-level, general-purpose, object-oriented programming language.
- Java is a low-level, general-purpose, object-oriented programming language.
- Java is a high-level, general-purpose, object-based programming language.
- Java is a high-level, general-purpose, native programming language.
Answer: 1
Description: Java is a high-level, general-purpose, object-oriented programming language.
- High-Level- A programming language that is designed to make it easier for humans to understand and write.
- General Purpose- A "general-purpose programming language" can be used for a wide variety of applications across different domains.
- Object Oriented- Object-oriented programming is a paradigm that treats everything as an object. It supports encapsulation, inheritance, polymorphism, and abstraction.
2) Which of the following Java editions is suitable for the development of web applications?
- Java ME
- Java SE
- Java EE
- Java FX
Answer: 3
Description:
Java EE (Java Enterprise Edition): It is an enterprise platform that is mainly used to develop web and enterprise applications. It is built on top of the Java SE platform. It includes topics like Servlet, JSP, Web Services, EJB, JPA, etc.
3) Java programming language is also known as…….?
- KAO
- OKA
- AOK
- OAK
Answer: 4
Description:
Java was developed by Sun Microsystems in the year 1995. Before Java, its name was Oak. Since Oak was already a registered company, so James Gosling and his team changed the name from Oak to Java.
4) Who invented Java Programming?
- Guido van Rossum
- James Gosling
- Dennis Ritchie
- Bjarne Stroustrup
Answer: 2
Description:
Java programming was developed by James Gosling at Sun Microsystems in 1995. James Gosling is well known as the father of Java.
5) Which component is used to compile, debug and execute the Java programs?
- JRE
- JIT
- JVM
- JDK
Answer: 4
Description:
JDK is a core component of Java Environment and provides all the tools, executables and binaries required to compile, debug and execute a Java Program.
Java Basics
- What is Java
- History of Java
- Features of Java
- C++ vs Java
- Java Hello World Program
- Java Program Internal Details
- How to set path in Java?
- JDK, JRE and JVM
- JVM: Java Virtual Machine
- Java Variables
- Identifiers in Java
- Java Data Types
- Type Casting in Java
- Unicode System in Java
- Operators in Java
- Java Keywords
Java Control Statements
- Java Control Statements
- Java If-else
- Java Switch
- Java For Loop
- Java While Loop
- Java Do While Loop
- Java Break
- Java Continue
- Java Comments
- Java Programs
Java Object Class
- Java OOPs Concepts
- Java Naming Conventions
- Object and Class in Java
- Constructor in Java
- static keyword in Java
- this keyword in Java
Methods in Java
- Methods in Java
- How to Call a Method in Java
- Recursion in Java
- Call By Value and Call By Reference in Java
Java Inheritance
Java Polymorphism
- Method Overloading in Java
- Method Overriding in Java
- Covariant Return Type in Java
- Java super keyword
- Java Instance Initializer block
- Java final keyword
- Polymorphism in Java
- Static and Dynamic Binding in Java
- Java instanceof operator
Java Abstraction
Java Encapsulation
Java Array
Java OOPs Misc
- Object class in Java
- Object Cloning
- Java Math class
- Wrapper Class in Java
- strictfp keyword
- Command Line Argument in Java
- Object vs Class
- Method Overloading vs Method Overriding
Java String
- Java String
- Why String is Immutable in Java?
- String Comparison in Java
- String Concatenation in Java
- Substring in Java
- Methods of String class
- StringBuffer in Java
- StringBuilder in Java
- String vs StringBuffer in Java
- StringBuffer vs StringBuilder in Java
- How to Create Immutable class in Java?
- Java toString method
- StringTokenizer class in Java
- Java String FAQs
Java Regex
Java Exception Handling
- Java Exceptions
- Java Try-catch block
- Java Multiple Catch Block
- Java Nested try
- Java Finally Block
- Java Throw Keyword
- Java Exception Propagation
- Java Throws Keyword
- Java Throw vs Throws
- Final vs Finally vs Finalize
- Exception Handling with Method Overriding
- Java Custom Exceptions
Java Inner Class
- Java inner class
- Member Inner class
- Anonymous Inner class
- Local Inner class
- static nested class
- Nested Interface
Java Multithreading
- Multithreading in Java
- Life Cycle of a Thread
- How to Create Thread
- Thread Scheduler in Java
- Sleeping a thread in Java
- Can we start a thread twice?
- What if we Call run() method
- Naming a thread in Java
- Thread Priority in Java
- Daemon Thread in Java
- Thread Pool in Java
- ThreadGroup in Java
- ShutdownHook Thread in Java
- Multitasking in Multithreading
- Garbage Collection in Java
- Java Runtime class
Java Synchronization
- Synchronization in java
- Java Synchronized Block
- Java Static Synchronization
- Deadlock in Java
- Inter-thread Communication in Java
- Interrupting a Thread in Java
- Reentrant Monitor in Java
Java Input/Output
- Java Input/Output
- Java FileOutputStream
- Java FileInputStream
- Java BufferedOutputStream
- Java BufferedInputStream
- Java SequenceInputStream
- Java ByteArrayOutputStream
- Java ByteArrayInputStream
- Java DataOutputStream
- Java DataInputStream
- Java FilterOutputStream
- Java FilterInputStream
- Java ObjectStream
- Java ObjectStreamField
- Java Console
- Java FilePermission
- Java Writer
- Java Reader
- Java FileWriter
- Java FileReader
- Java BufferedWriter
- Java BufferedReader
- Java CharArrayReader
- Java CharArrayWriter
- Java PrintStream
- Java PrintWriter
- Java OutputStreamWriter
- Java InputStreamReader
- Java PushbackInputStream
- Java PushbackReader
- Java StringWriter
- Java StringReader
- Java PipedWriter
- Java PipedReader
- Java FilterWriter
- Java FilterReader
- Java Scanner
Java File Handling
- File Handling in Java
- Java File class
- How to Create a File in Java
- How to Read File in Java
- How to Delete a File in Java
- Java FilePermission class
- Java FileDescriptor class
- Java RandomAccessFile
- How to Create a Zip File in Java
- How to Read and Print All Files from a Zip file in Java?
- Java Path vs File
Java Serialization
Java Networking
- Java Networking Concepts
- Socket Programming in Java
- Java URL class
- Java URLConnection class
- Java HttpURLConnection
- Java InetAddress class
Java Reflection
- Java Reflection API
- Java newInstance() method
- javap tool
- creating javap tool
- How to Call private method from another class?
Java Memory Management
- Java Memory Management
- Stack vs Heap Memory in Java
- Java Garbage Collection
- How Garbage Collection Works in Java?
- Memory Leaks in Java
Java Collections
- Collections in Java
- Java ArrayList
- Java LinkedList
- ArrayList vs LinkedList
- Java List Interface
- Java LinkedHashSet
- Java TreeSet
- Queue & PriorityQueue
- Deque & ArrayDeque
- Java Map Interface
- Java HashMap
- Working of HashMap
- Java LinkedHashMap
- Java TreeMap
- Java Hashtable
- HashMap vs Hashtable
- Java EnumSet
- Java EnumMap
- Java Collections class
- Sorting Collections in Java
- Comparable interface in Java
- Comparator interface in Java
- Comparable vs Comparator
- Properties class in Java
- ArrayList vs Vector
- Java Vector
- Java Stack
- Java Collection Interface
- Java Iterator Interface
- Java Deque Interface
- Working of HashSet in Java
Data Structures in Java
- Data Structures in Java
- Linear Search in Java
- Binary Search in Java
- Insertion Sort in Java
- Selection Sort in Java
- Bubble Sort in Java
- Merge Sort in Java
Java JDBC
- JDBC Introduction
- JDBC Driver
- Java Database Connectivity with 5 Steps
- Connectivity with Oracle
- Connectivity with MySQL
- Access without DSN
- DriverManager
- Connection
- Statement
- ResultSet
- PreparedStatement
- Java ResultSetMetaData Interface
- DatabaseMetaData
- Store image
- Retrieve image
- Store file
- Retrieve file
- CallableStatement
- Transaction Management
- Batch Processing
- RowSet Interface
- JDBC MCQ
Java 8
Java RMI
Internationalization in Java
- Internationalization (i18N) in Java
- ResourceBundle class
- Internationalization with Date
- Internationalization with Time
- Internationalization with Number
- Internationalization with Currency