WWW Geeksforgeeks Org Java

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Courses Tutorials Jobs Practice Sign In

Data Structures Algorithms Interview Preparation Topic-wise Practice C++ Java Python Competitive Programming Machine Learning HTML SDE Sheet Puzzles GFG School

Basics
Practice Problems, POTD
Java Programming Language
Java Programming Language Streak, Weekly Contests
& More!
Last Updated : 05 Aug, 2022

View Details
Introduction to Java

Setting up the environment in Read Discuss


Java

Java Basic Syntax

Java Hello World Program

Command Line Arguments in


Java

How JVM Works – JVM


Architecture?

Differences between JDK, JRE


and JVM

Java Identifiers
Java is one of the most popular and widely used programming languages.

Data types in Java


Java has been one of the most popular programming languages for many years.

Java is Object Oriented. However, it is not considered as pure object-oriented as it provides


Variables in Java
suppor t for primitive data types (like int, char, etc)

Comments in Java The Java codes are first compiled into byte code (machine-independent code). Then the

byte code runs on Java Vir tual Machine (JVM) regardless of the underlying architecture.

Operators in Java Java syntax is similar to C/C++. But Java does not provide low-level programming

functionalities like pointers. Also, Java codes are always written in the form of classes and

Ways to read input from console object s.

in Java Java is used in all kinds of applications like Mobile Applications (Android is Java-based),

desk top applications, web applications, client-ser ver applications, enterprise applications,

Flow Control
and many more.

When compared with C++, Java codes are generally more maintainable because Java does

Strings
not allow many things which may lead to bad/inefficient programming if used incorrectly. For

example, non-primitives are always references in Java. So we cannot pass large object s

Arrays
(like we can do in C++) to functions, we always pass references in Java. One more example,

since there are no pointers, bad memor y access is also not possible.

Methods When compared with P ython, Java kind of fit s between C++ and P ython. The programs are

written in Java typically run faster than corresponding P ython programs and slower than

Constructors C++. Like C++, Java does static type checking, but P ython does not.
WHAT'S NEW
OOP Concepts Data Structures &
Algorithms- Self Paced
Course
Exception Handling
View Details
Interfaces & Abstract Classes
Complete Interview
Preparation- Self Paced
Collections Course

View Details
Multithreading
Simple Hello World Program :

File Handling // A Java program to print "Hello World"


public class GFG {
    public static void main(String args[])
    {
        System.out.println("Hello World");
    }
}
Run on IDE

Output :

Hello World

Recent Articles on Java

Java Programs – Basic s to Advanced

Skip to content
Start Your Coding Journey Now!
Overview, Basic s, Input/Output, Flow Control, Operators, Strings, Arrays, OOPs Concepts,

Login
Inheritance, A bstraction, Encapsulation, Polymorphism, Constructors, Methods, Interfaces,
Register
Wrapper Classes, Keywords, Access Modifiers, Memory Allocation, Classes, Packages,

Collection Framework, List, Queue, Map, Set, Exception Handling, Multithreading,

Synchronization, File Handling, Regex, Java IO, Networking, Java 8 Features, Date & Time,

JDBC, Miscellaneous, Interview Questions

Overview of Java
Introduction to Java
Packages in Java
Histor y of Java

Java vs C++ P ython


Java Packages

How to Download and Install Java?


How to create a package in Java

Setting Up the Environment in Java


java.util package

How to Download and Install Eclipse on


java.lang package

Windows?
java.io package

Java Development Kit (JDK) in Java

JVM and it s architecture


Collection Framework
Differences between JDK, JRE, and JVM

Just In Time Compiler


Java Collection Framework

Difference Between JIT and JVM


Collections class in Java

Difference Between Byte Code and


Collection Inter face in Java

Machine Code
How to learn Java collections

How is the Java platform independent?


List Inter face in Java

Queue Inter face in Java

Basics of Java
Map Inter face in Java

Set in Java

Java Basic Syntax


Iterator in Java

First Java Program (Hello World)


Comparator in Java

Datatypes in Java
Difference between Comparator and

Difference between Primitive and Non-


Comparable in Java

Primitive Datatypes

Java Identifiers
List
Operators in Java

Java Variables
ArrayList in Java

Scope of Variables
Vector class in Java

Wrapper Classes in Java


Stack class in Java

LinkedList in Java

Input/Output in Java
A bstractList

A bstractSequentialList

How to take Input from users in Java


CopyOnWriteArrayList

Scanner class in Java


Custom ArrayList in Java

BufferedReader class in Java

Queue
Scanner vs BufferedReader in Java

Ways to Read Input from Console in Java

Print Output in Java


A bstractQueue

Difference between print() and println() in


ArrayBlockingQueue

Java
ConcurrentLinkedQueue

Formatted Output s in Java


LinkedBlockingQueue

Fast Input-Output for Competitive


LinkedTransferQueue

Programming in Java
PriorityBlockingQueue

Deque in Java

Flow Control in Java


ArrayDeque

Concurrent LinkedDeque

Decision making in Java


LinkedBlocking Deque

If Statement in Java
Priority Queue in Java

If-Else Statement in java

Map
If-Else-If ladder in Java

Loops in Java

For loop
EnumMap

While Loop
HashMap

Do while loop
Working of HashMap

For each loop


Traverse through a HashMap in Java

Continue Statement in java


WeakHashMap

Break Statement In Java


LinkedHashMap

Usage of Break in Java


IdentityHashMap

Return Statement in Java


ConcurrentHashMap

Dictionar y

Operators in Java
HashTable

Sor tedMap

Arithmetic Operator
TreeMap

Unar y Operator

Skip to content
Stack
Start Your Coding Journey Now!
A ssignment Operator Vector

Relational Operator
Login Register
Logical Operator Set
Ternar y Operator

Bitwise Operator A bstractSet

EnumSet

Strings in Java HashSet

TreeSet

Introduction of Strings in Java Sor tedSet

String class in Java Set-1 | Set-2 LinkedHashSet

Why strings are immutable in Java? NavigableSet

StringBuffer class in Java ConcurrentSkipListSet

StringBuilder class in Java CopyOnWriteArraySet

Strings vs StringBuffer vs StringBuilder in

Java Exception Handling in Java


StringTokenizer class in Java Set-1 | Set-2

StringJoiner in Java Exceptions in java

Java String Programs Types of Exceptions

Difference between Checked and

Arrays in Java Unchecked Exceptions

Tr y, Catch, Finally, throw, and throws

Introduction to Arrays in Java Flow control in Tr y catch block

Arrays class in Java Throw vs Throws

Multi-Dimensional Array in Java Final vs Finally vs Finalize

How to declare and initialize 2D arrays in User-defined custom exception

Java Chained Exceptions

Jagged array in Java Null pointer Exceptions

Final Arrays in Java Exception handling with method Overriding

Reflect Arrays in Java

Difference between util.Arrays and Multithreading in Java


reflect.Arrays

Java Array Programs Introduction to Multithreading in Java

Lifecycle and Stages of a Thread

OOPS in Java Thread Priority in Java

Main Thread in Java

OOPS Concept in Java Thread class

Why Java is not a purely Object-Oriented Runnable inter face

L anguage? How to name a thread

Classes and Object s star t() method in thread

Naming Convention in Java Difference between run() and star t()

Methods in Java Method

Access Modifiers in Java sleep() method

Constructors in Java Daemon thread

Four pillars of OOPS in Java Thread Pool in Java

Inheritance in Java Thread Group in Java

A bstraction in Java Thread Safety in Java

Encapsulation in Java ShutdownHook

Polymorphism in Java Multithreading Tutorial

Inter faces in Java

This reference in Java Synchronization in Java

Inheritance in Java Java Synchronization

Impor tance of Thread synchronization in

Introduction to Inheritance in Java Java

Inheritance and Constructors Method and Block Synchronization in Java

Multiple Inheritance in Java Local framework s vs thread

Inter faces and Inheritance synchronization

Difference between Inheritance in C++ and Difference between Atomic, Volatile, and

Java Synchronized in Java

Deadlock in Multithreading

Abstraction in Java Deadlock Prevention and Avoidance

Difference between Lock and Monitor in

Introduction to A bstraction in Java Concurrency

A bstract Keyword in Java Reentrant Lock

A bstract classes in Java

A bstract class vs Inter face in Java File Handling in Java


Control A bstraction in Java

Difference between Data Hiding and File Class in java

A bstraction How to create files in java

How to read files in java

Encapsulation in Java Skip to content


How to write on files in java
Start Your Coding Journey Now!
Introduction to Encapsulation in Java How to delete a file in java

Difference between Encapsulation and


Login
File Permissions
Register
A bstraction FileReader

File Writer

Polymorphism in Java FileDescriptor class

RandomAccessFile class

Introduction to Polymorphism in Java

Difference between Inheritance and Java Regex


Polymorphism

Runtime Polymorphism in Java Introduction to Java Regex

Compile-Time vs Runtime Polymorphism How to write Regex expressions

Matcher class

Constructors in Java Pattern class

Quantifiers

Introduction to Constructors in Java Character class

Copy Constructor in Java

Constructor Overloading Java IO


Constructor Chaining

Private Constructors and Singleton Class Introduction to Java IO

Reader Class

Methods in Java Writer Class

FileInput stream

Introduction to methods in Java File Output stream

Different method calls in Java BufferedReader Input Stream

Difference between Static methods and BufferedReader Output stream

Instance methods in Java BufferedReader vs Scanner

A bstract methods in Java Fast I/O in Java

Method Overriding in Java

Method Overloading in Java Java Networking


Method Overloading Vs Method Overriding

Introduction to Java Networking

Interfaces in Java TCP architecture

UDP architecture

Java Inter faces IP V4 vs IP V6

Inter faces and Inheritance in Java Connection-oriented vs connectionless

Difference between Inter face and Class in protocols

Java Socket programming in Java

Functional Inter face Ser ver Socket class

Nested Inter face URL class and methods

Marker Inter face

Comparator Inter face Java SE 8 Features

Wrapper Classes in Java L ambda Expressions

Streams API

Need of Wrapper classes in Java New Date/ Time API

How to create instances of Wrapper classes Default Methods

Character class in Java Functional Inter faces

Byte class in Java Method references

Shor t class in Java Optional class

Integer class in Java Stream Filter

Long class in Java Type Annotations

Float class in Java String Joiner

Double class in Java

Boolean class in Java Java Date & Time


Autoboxing and Unboxing

Type Conversion in Java Date Class in Java

Methods of the Date class

Keywords in Java Java Current Date and time

Compare dates in Java

List of all Java Keywords

Impor tant Keywords in Java Java JDBC


Super Keyword

Final Keyword Introduction to Java JDBC

A bstract keyword JDBC Driver

Static Keyword JDBC Connection

This Keyword Types of Statement s in JDBC

Enum Keyword in Java JDBC Tutorial

Transient keyword in java

Volatile keyword in java Java Miscellaneous


Final, Finally, and Finalize in Java

Skip to content
Introduction to Reflection API
Access Modifiers in Java
Start Your Coding Journey Now!
Java IO Tutorial

Login
JavaFX Tutorial
Register
Introduction to Access Modifiers in Java Java RMI

Public vs Protected vs Package vs Private How to Run Java RMI application?

Access Modifier in Java Java 17 New Features

Access Modifiers Vs Non-Access Modifiers

in Java
Interview Questions on Java

Memory Allocation in Java Commonly A sked Java Inter view Questions

Set – 1 | Set – 2

Java Memor y Management Inter view Questions For Java Professionals

How are Java object s stored in memor y 10 Most A sked Questions on Java

Stack vs Heap memor y allocation Java Multiple Choice Questions

Types of memor y areas allocated by JVM

Garbage Collection in Java

Heap and Stack memor y allocation

Types of JVM Garbage Collectors in Java

Memor y leak s in Java

Java Vir tual Machine(JVM) Stack Area

Classes of Java

Classes and Object s

Understanding classes and object s in Java

Class vs inter face

Singleton class in java

Object class in java

Inner class in java

A bstract classes in java

Throwable class in java

GeeksforGeeks Courses:

Java Programming Foundation – Self Paced Course

Do you really think that you need some prior programming knowledge to learn JAVA? Well,

we don’t think so! Now you can star t learning JAVA from scratch with so much ease with our

Java Programming Foundation Course. A self-paced course to help you learn about JAVA

basic concepts, data types, operators, functions & much more. To star t your learning

journey. Enrol now!

Live Courses

Get best-in-industr y real-time GFG Live Courses to upgrade yourself and get into your

dream company. You can attend these live classes from any geographical location and here

you can ask your doubts to the instructor just like an offline classroom program. Do check out

these wor thwhile Live Courses by Geek sforGeek s- System Design Live, Competitive

Programming Live, and more!

Skip to content
StartCompany
Your CodingLearn
Journey Now! News Login Languages
RegisterWeb Development Contribute
A-143, 9th Floor, Sovereign Corporate Tower, About Us Algorithms Python Web Tutorials Write an Article
Sector-136, Noida, Uttar Pradesh - 201305 Top News
[email protected] Careers Data Structures Java Django Tutorial Improve an Article
Technology
In Media SDE Cheat Sheet CPP HTML Pick Topics to Write
Work & Career
Contact Us Machine learning Golang JavaScript Write Interview Experience
Business
Privacy Policy CS Subjects C# Bootstrap Internships
Finance
Copyright Policy Video Tutorials SQL ReactJS Video Internship
Lifestyle
Courses Kotlin NodeJS
Knowledge

@geeksforgeeks
, Some rights reserved

You might also like