Java tutorial for beginners and professionals with examples on Basics, OOPs, Methods, Overloading, Overriding, Inheritance, Polymorphism, Interfaces, Packages, Abstract classes, String handling, Exception handling, IO, Collections, Multithreading, Serialization and more.
As we are going to start learn Java, which is a programming language. So, let us have a brief look at programming language first.
What is language?
A way of communication is known as language. e.g. Hindi, English etc.
What is a Program?
A set of instructions which is used to perform a specific task.
What is a Programming Language?
An artificial language used to write programs which can be translated into machine language and executed by computer with the help of some special software.
What is a Platform?
Dictionary meaning: A raised level surface on which things can stand.
In programming: Hardware or software on which a program can execute/run.
e.g. – c, c++, Java etc.
What is Java?
Java is a high level programming language and also known as platform because of its JRE (java runtime environment).
Brief History of Java.
Java language project initially started in June 1991 by James Gosling, Mike Sheridan, and Patrick Naughton. An oak tree stood outside Gosling’s office at that time and java named as oak initially. It later renamed as Green and was later renamed as java from java coffee.
Base concept of java language project.
Write once, run anywhere (WORA) – that means java program can run anywhere and on any platform. When java code is compiled it is converted into byte code. Now only this byte code is needed to run using JVM, no need of source code and recompilation.
Java released versions:
1. JDK Alpha and Beta (1995)
2. JDK 1.0 (23rd Jan, 1996)
3. JDK 1.1 (19th Feb, 1997)
4. J2SE 1.2 (8th Dec, 1998)
5. J2SE 1.3 (8th May, 2000)
6. J2SE 1.4 (6th Feb, 2002)
7. J2SE 5.0 (30th Sep, 2004)
8. Java SE 6 (11th Dec, 2006)
9. Java SE 7 (28th July, 2011)
10. Java SE 8 (18th March, 2014)
11. Java SE 9 (21th Sept, 2017)
12. Java SE 10 (20th March, 2018)
13. Java SE 11 (25th Nov, 2018)
14. Java SE 12 (19th March, 2019)
Java tutorial:
- java features
- jvm (Java Virtual Machine)
- Difference between JVM, JRE and JDK
- Java Coding Guidelines
- Variable and DataTypes in java
- Hello world java program
- How to set permanent path in java?
- Object-oriented programming style
- Object and Class in Java
- OOPs concepts in java
- Abstraction in java
- Encapsulation in java
- Polymorphism in java
- Method overloading in java
- Method overriding in java
- Dynamic method dispatch in java
- Association in java
- Inheritance in java
- Aggregation in java
- Command line arguments in java
- How to execute command line argument program in eclipse
- How to read input from command line in Java using Scanner
- Abstract class in java
- Interface in java
- Constructor in java
- Package in java
- Access modifier in java
- Static import in java
- Package class in java
- this keyword in java
- Instance Initializer block in java
- super keyword in java
- static keyword in java
- final keyword in java
- String handling in java
- String comparison in java
- String concatenation in java
- Substring in java
- Immutable class in java
- toString() method in java
- string class methods in java
- charAt(int index) String function in java
- startsWith(String prefix) and endsWith(String suffix) string functions in java
- indexOf(String str) and lastIndexOf(String str) String functions in java
- Java toLowerCase toUpperCase
- intern() String Method in java
- String length() in java
- trim() String functions in java
- StringBuffer in java
- append(String str) StringBuffer method in java
- insert(int offset, String str) StringBuffer method in java
- replace(int startIndex, int endIndex, String str) StringBuffer method in java
- delete(int startIndex, int endIndex) StringBuffer method in java
- reverse() StringBuffer method in java
- capacity() StringBuffer method in java
- ensureCapacity(int minCapacity) StringBuffer method in java
- StringTokenizer in java
- StringBuilder in java
- append(String str) StringBuilder method in java
- insert(int offset, String str) StringBuilder method in java
- replace(int startIndex, int endIndex, String str) StringBuilder method in java
- delete(int startIndex, int endIndex) StringBuilder method in java
- reverse() StringBuilder method in java
- capacity() StringBuilder method in java
- ensureCapacity(int minCapacity) StringBuilder method in java
- Exception handling in java
- try and catch blocks in java
- Multiple catch blocks in java
- Nested try block in java
- Finally in java
- throw keyword in java
- throws keyword in java
- Exception propagation in java
- Exception handling with method overriding in java
- Custom exception in java
- Throwable class methods in java
- Thread life cycle in java
- Way of creating thread in java
- Methods of Thread class
- Thread Scheduling in java
- Thread priority in java
- Naming a thread in java
- Joining a thread in java
- Daemon thread in java
- Can we start a thread twice?
- Can we call run method directly?
- Thread.yield() and Thread.sleep() methods
- Deadlock in java
- Starvation in java
- Synchronization in java
- Synchronized method in java
- Static synchronization in java
- Synchronized block in java
- Inter-thread communication in java
- FileInputStream and FileOutputStream in java
- Byte Streams in java
- DataInputStream and DataOutputStream in java
- BufferedInputStream and BufferedOutputStream in java
- FileReader and FileWriter in java
- How To Check If A File Exists In Java
- Serialization and Deserialization in java
- Transient keyword in java
- Marker interface in java
- Privacy Policy
- Exception handling tutorial Java
- String tutorial in java
- Multithreading Tutorial in Java
- Java input output tutorial
- Byte data type example in java
- Short Data Type in Java
- Int in Java
- Long java
- Float Java
- Double Java
- Boolean Java
- Char Java
- Java Data Types Tutorial
- If else Java
- Switch Java
- For Loop Java
- Enhanced For Loop Java
- While Loop Java
- Do While Loop Java
- Break Java
- Continue Java
- Program to print alphabets both in small and capital
- Program to perform arithmetic operations
- Armstrong Number Program in Java
- Even Odd Program in Java
- factorial-program-in-java-output
- Factorial Program Using Recursion in Java
- Fibonacci Series Program in Java
- Palindrome Number Program in Java
- Prime Number Program in Java
- Swap Two Numbers Without Using Third Variable in Java
- Swap Numbers in Java
- Reverse Number in Java
- Calculate Circle Area using Java Example
- Calculate Circle Perimeter using Java Example
- Calculate Rectangle Area using Java Example
- Calculate Rectangle Perimeter using Java Example
- Leap year java program
- List Even Numbers Java Example
- List Odd Numbers Java Example
- Floyd Triangle in Java Example
- Generate Pyramid For a Given Number Example in Java
- Generate Pyramid Triangle Example in Java
- Java examples programs
- list all file names from folder java
- read all files from folder java get list program
- How to filter the files by file extensions java
- read file content in byte array java
- read file content line by line java program
- get file list from a folder filtered by extensions java
- get file URI reference in java
- store and read objects from a file java program
- create and store property file dynamically java
- store property file as xml file java
- get file last modified time in java program
- convert byte array to inputstream java program
- convert inputstream to bufferedreader java program
- convert byte array to bufferedreader java
- set file permissions java program
- create temporary file java program
- store data into temporary file java
- delete temporary file java program
- write string content to a file java
- write byte content to a file java program
- delete file in java program
- rename file in java program
- make a file read only java
- check if file is writable java program
- make a read only file writable java
- check if a file is hidden java program
- String to int in java
- String to integer with leading zeros in java
- Int to string in java
- String to double in java
- Double to string in java
- String to long in java
- Long to string in java
- String to boolean in java
- Boolean to string in java
- Char to string in java
- String to char in java
- Char array to string in java
- String to date in java
- Date to string in java
- Ascii to string in java
- Float to string in java
- String to arraylist in java
- java random class tutorial
- How to generate random numbers in a given range in java?
- How to generate same random number sequence every time?
- how to create random string in java?
- how to create random alphanumeric in java?
- java number pattern programs
- java star pattern programs
- Object cloning in java
- Find duplicate elements in an array in java
- Find second largest element in an array in java
- Check the equality of two arrays in java
- Find all pairs of elements in an integer array whose sum is equal to a given number
- Find continuous sub array whose sum is equal to a given number in java
- Find the intersection of two arrays in java
- Separate zeros from non-zeros in an integer array in java
- Find all the leaders in an integer array in java
- Find a missing number in an integer array in java
- Array to ArrayList and an ArrayList to array in java
- Count occurrences of each element in an array in java
- Reverse an array without using an additional array in java
- Remove duplicate elements from an array in java
- Find union and intersection of multiple arrays in java
- Find the most frequent element in an array in java
- Java interview programs
- java array interview programs
- Shallow copy and deep copy in java
- java visitor design pattern
- java memento design pattern
- how to create url object in java?
- Create url object with properties in java
- Create url from file in java
- Read url properties in java
- Create relative url in java
- Compare two urls in java
- Read or get contents of a url in java
- Encode url in java
- Decode url in java
- Get ip address in java
- Get ip address of host in java
- how to get hostname from ip address in java?
- Get system hostname in java
- Get list of all ip addresses on network in java
- Java networking tutorial
- difference between thread start and run method
- Why we call start method in thread
- Which is a better way to create a thread in java
- can we override start method in thread?
- can we override run method in thread?
- how to get current thread in java?
- hashCode and equals method in java
- HashMap internal working in java
- How hashmap stores null key?
- how hashset works internally in java?
- Concurrency in java
- concurrency issues in java
- concurrency solutions in java
- reentrantlock in java
- readwritelock in java
- semaphore in java
- countdownlatch in java
- exchanger in java
- atomic variables in java
- atomicboolean in java
- atomicinteger in java
- atomiclong in java
- AtomicIntegerArray in java
- AtomicLongArray in java
- Thread pool in java
- Thread group in java
- shutdown hook in java
- Executor framework in java
- fork join in java
- callable and future in java
- difference between callable and runnable
- Java Runtime exec() method
- Shutdown system in Java
- Shutdown windows system in Java
- Restart system in Java
- Java Runtime availableProcessors
- Java Runtime freeMemory() and totalMemory() method
- Arrays in Java
- Java Operators
- Java Type Casting
- Java Wrapper Classes
- test
- Inner Class Java
- String Performance Hints
- replace all square brackets in a string java regex
- java get screen size
- VM options javafx
- Android manifest cleartext traffic permitted
- Get minimum value in Arraylist java
- Get maximum value in Arraylist java
- jFrame set size
- Javafx grid center
- Seconds To Hours Java
- Executing an EXE from Java and getting input and output from EXE
- jLabel change font style
- jLabel text center
- Java int to roman
- Get player from UUID
- java.awt.event is not accessible
- import math java
- Java full screen jFrame
- RGB to HEX java
- ANSI Colors Java
- Console log java
- Java console and terminal color
- Change java version command line debian
- Ubuntu change java version Linux
- Java create window
- Change font size java swing
- Random colors java
- Java every second
- Javafx tableview remove all rows
- java age from date
- Left fold java
- close a jframe in java with an if statement
- Lombok maven dependency
- Bukkit scoreboard
- Spigot repeating task
- Java log base 2
- Java get next enum
- Java create jframe
- sum of digits in java
- set java_home in mac
- Top Wishlisted games on steam
- Get class by name java
- Append character at first position in StringBuilder java
- Java get mouse position on screen
- Sleep in java
- Maven java 8
- Error:java: Source option 5 is no longer supported. Use 6 or later.
- Error:java: Source option 5 is no longer supported. Use 7 or later.
- Zufallszahlen in java
- Send action bar spigot
- Java FileWriter new line
- Random element from a list java
- Java execution time
- Exit from jshell
- Copy to clipboard java
- Upgrade java 8 to 11 in ubuntu
- Java stream find specific element
- Show dialog fragment from adapter
- Detect operating system in java
- Best ASCII art characters
- Bukkit inventory set name
- Spring boot maven run with profile
- Divide with float java
- SpringBoot starter jpa
- Regrex for letter in java
- Hardware assisted virtualization and data execution protection must be enabled in the BIOS
- Spigot spawn entity
- Save map in file java
- Max value in priority queue java
- No Java files found that extend CordovaActivity
- Echo java_home in windows cmd