Skip to content
geeksforgeeks
  • DSA
    • Data Structures
      • Arrays
      • Matrix
      • Strings
      • Linked List
        • Singly Linked List
        • Doubly Linked List
        • Circular Linked List
        • Doubly Circular Linked List
        • Linked List Tutorial
      • Stack
      • Queue
      • Tree
        • Generic Tree
        • Binary Tree
        • Binary Search Tree
        • AVL Tree
        • B Tree
        • B+ Tree
        • Red Black Tree
        • Tree Data Structure Tutorial
      • Heap
      • Hashing
      • Graph
      • Set Data Structure
      • Map Data Structure
      • Advanced Data Structure
      • Data Structures Tutorial
    • Algorithms
      • Analysis of Algorithms
        • Design and Analysis of Algorithms
        • Asymptotic Analysis
        • Asymptotic Notations
        • Worst, Average and Best Cases
      • Searching Algorithms
        • Linear Search
        • Binary Search
        • Searching Algorithms Tutorial
      • Sorting Algorithms
        • Selection Sort
        • Bubble Sort
        • Insertion Sort
        • Merge Sort
        • Quick Sort
        • Heap Sort
        • Counting Sort
        • Radix Sort
        • Bucket Sort
        • Sorting Algorithms Tutorial
      • Greedy Algorithms
      • Dynamic Programming
      • Graph Algorithms
      • Pattern Searching
      • Recursion
      • Backtracking
      • Divide and Conquer
      • Mathematical Algorithms
      • Geometric Algorithms
      • Bitwise Algorithms
      • Randomized Algorithms
      • Branch and Bound
      • Algorithms Tutorial
    • DSA Tutorial
    • Competitive Programming
    • Company Wise SDE Sheets
      • Facebook SDE Sheet
      • Amazon SDE Sheet
      • Apple SDE Sheet
      • Netflix SDE Sheet
      • Google SDE Sheet
      • Wipro Coding Sheet
      • Infosys Coding Sheet
      • TCS Coding Sheet
      • Cognizant Coding Sheet
      • HCL Coding Sheet
    • DSA Cheat Sheets
      • SDE Sheet
      • DSA Sheet for Beginners
      • FAANG Coding Sheet
      • Love Babbar Sheet
      • Mass Recruiter Sheet
      • Product-Based Coding Sheet
      • Company-Wise Preparation Sheet
    • Top Interview Questions
      • Top 100 DSA Interview Questions Topic-wise
    • Puzzles
      • All Puzzles
      • Top 100 Puzzles Asked In Interviews
      • Top 20 Puzzles Commonly Asked During SDE Interviews
  • Tutorials
    • Python Tutorial
      • Taking Input in Python
      • Python Operators
      • Python Data Types
        • Python Numbers
        • Python String
        • Python Lists
        • Python Tuples
        • Sets in Python
        • Python Dictionary
      • Python Loops and Control Flow
        • Python If Else
        • Python For Loops
        • Python While Loops
        • Python Breaks
        • Python Continue Statement
        • Python Pass Statement
      • Python Functions
      • Python OOPS Concept
      • Python Exception Handling
      • Python File Handling
    • Web Development In Python
      • Django
        • Getting started with Django
        • Create an App in Django
        • Views In Django
        • Django Templates
        • Django URL patterns
        • Django Admin Interface
        • Django Models
      • Django Database
        • Mysql database with Django
        • PostgreSQL Database in Django
        • MongoDB with Django
      • Django CRUD
      • Django Forms
      • Django Static File
      • Projects for Beginners
      • Django Interview Questions
      • Django Tutorial
      • Flask
        • Web Development Using Flask
        • Flask App Routing
        • URL building in Flask
        • Flask Templates
        • Templating With Jinja2 in Flask
        • Flask Model
        • Database with Flask SQL Alchemy
        • Authentication with Flask
        • WTForms in Flask
        • Static files in Flask
        • Python Flask Projects
        • Flask Interview Questions
      • Frontend Projects
        • Building a Survey Form using HTML and CSS
        • Food delivery system using HTML and CSS
        • ToDo webapp using Django
        • Building Blog CMS
        • add Pagination in Django
        • Tailwind CSS with Django
        • Django with Reactjs
      • Postman
      • Github
    • Python Data Structures
      • Python DSA
      • List
      • Dictionaries
      • Strings
      • Linked List
        • Python Linked List
        • Singly Linked List
        • Doubly Linked List
        • Circular Linked List
        • Doubly circular Linked List
      • Stack
      • Queue
        • Queue
        • Deque
        • Priority Queue
      • Tree
        • Generic Tree
        • Binary Tree
        • Binary Search Tree
        • AVL Tree
        • B Tree
        • Red Black Tree
      • Heap
        • Heap
        • Max Heap
        • Heap Queue
        • Min heap
      • Hashing
      • Graph
      • Sets
      • Map
      • Advance Data Structure
      • Sorting Algorithms
        • Selection Sort
        • Bubble Sort
        • Insertion Sort
        • Merge Sort
        • Quick Sort
        • Heap Sort
        • Counting Sort
        • Radix Sort
        • Bucket Sort
      • Searching Algorithms
        • Linear Search
        • Binary Search
    • Python Exercises
      • Python List Exercise
      • Python String Exercise
      • Python Tuple Exercise
      • Python Dictionary Exercise
      • Python Set Exercise
      • Python Design Patterns
      • Python Programming Examples
      • Python Practice Questions
    • Java
      • Java Programming Language
        • Java Tutorial
        • Data Types
        • Variables
        • Operators
          • Operators in Java
          • Arithmetic Operators
          • Unary Operators
          • Assignment Operators
          • Relational Operators
          • Logical Operators
          • Ternary Operators
        • Flow Control in Java
          • Flow Control
          • if Statement
          • if-else Statement
          • if-else-if Ladder
          • Continue Statement
          • Break Statement
          • Return Statement
        • Loops in Java
          • Loops
          • do-while Loop
          • For Loop
          • For-each Loop
        • Methods
        • Strings
        • Arrays
        • OOPs Concepts
          • OOPs Concepts
          • Classes and Objects
          • Access Modifiers
          • Inheritance
          • Abstraction
          • Encapsulation
          • Polymorphism
        • Interface
        • Packages
        • Multithreading
        • File Handling
        • Regular Expression
      • Java Collections
        • Java Collections
        • Collection Class
        • List Interface
        • ArrayList
        • Vector Class
        • Stack Class
        • LinkedList Class
        • Queue Interface
        • Set Interface
        • HashSet Class
        • TreeSet
        • Map Interface
        • HashMap Class
        • HashTable Class
        • Iterator
        • Comparator
        • Collection Interview Questions
      • Java 8 Tutorial
      • Java Programs
        • Java Programming Examples
        • Java Array Programs
        • Java String Programs
        • Java Date-Time Programs
        • Java File Handling Programs
        • Java Collection Programs
        • Java JDBC Programs
        • Java Apache POI Programs
        • Java OpenCV Programs
      • Java Interview Questions
        • Java Interview Questions
        • Core Java Interview Questions-Freshers
        • Java Multithreading Interview Questions
        • OOPs Interview Questions and Answers
      • Java Exercises
      • Java Quiz
        • Java Quiz
        • Core Java MCQ
      • Java Projects
      • Advance Java
        • Spring Tutorial
        • Spring Boot Tutorial
        • Spring Boot Interview Questions
        • Spring MVC Tutorial
        • Spring MVC Interview Questions
        • Hibernate Tutorial
        • Hibernate Interview Questions
    • Programming Languages
      • Python
      • Java
      • C
      • C++
      • JavaScript
      • PHP
      • R Tutorial
      • C#
      • SQL
      • Scala
      • Perl
      • Go Language
      • Kotlin
    • System Design
      • System Design Tutorial
        • What is System Design
        • Key Terminologies in System Design
        • Analysis and Architecture of Systems
        • Scalability in System Design
        • Databases in System Design
        • High Level Design or HLD
        • Low Level Design or LLD
        • Communication Protocols
        • Web Servers and Proxies
        • Case Studies in Designing Systems
        • Complete System Design Tutorial
      • Software Design Patterns
        • Factory Pattern
        • Observer Pattern
        • Singleton Design Pattern
        • Decorator Pattern
        • Strategy Pattern
        • Adapter Pattern
        • Command Pattern
        • Iterator Pattern
        • Prototype Design Pattern
        • All Design Patterns
      • System Design Roadmap
      • Top 10 System Design Interview Questions and Answers
    • Interview Corner
      • Company Preparation
      • Top Topics
      • Practice Company Questions
      • Interview Experiences
      • Experienced Interviews
      • Internship Interviews
      • Competitive Programming
      • Multiple Choice Quizzes
      • Aptitude for Placements
    • Computer Science Subjects
      • Mathematics
      • Operating System
      • DBMS
      • Computer Networks
      • Computer Organization and Architecture
      • Theory of Computation
      • Compiler Design
      • Digital Logic
      • Software Engineering
    • DevOps
      • GIT
      • AWS
      • Docker
      • Kubernetes
      • Microsoft Azure Tutorial
      • Google Cloud Platform
    • Linux
      • Linux Tutorial
      • Linux Commands A-Z
      • Linux Commands Cheatsheet
      • 25 Basic Linux Commands
      • File Mangement in Linux
      • File Permission Commands
        • chmod Command
        • chown Command
        • chgrp Command
        • unmask Command
      • Linux System Administration
      • Linux File System
      • Linux Shell Scripting
      • Linux Networking
      • Linux Firewall
      • Linux Interview Questions
    • Software Testing
      • Software Testing Tutorial
        • Software Testing Tutorial
        • What is Software Testing
        • Principles of Software Testing
        • Types of Software Testing
        • Levels of Software Testing
        • Automation Testing
        • Manual Testing
      • Testing Tools
        • Software Testing Tools
        • Defect Testing Tools
        • Cross-Browser Testing Tools
        • Integration Testing Tool
        • Unit Testing Tools
        • Mobile Testing Tools
        • GUI Testing Tool
        • Security Testing Tools
        • Penetration Testing Tools
      • Selenium
        • Selenium Tutorial
        • Selenium Basics
        • Selenium Python
      • Jira
        • Jira Tutorial
        • JIRA Installation
        • JIRA Login
        • JIRA Dashboard
      • Software Engineering
        • Software Engineering Tutorial
        • Software Development Life Cycle (SDLC)
        • Software Characteristics
        • Software Quality
        • Waterfall Model
        • Iterative Waterfall Model
        • Spiral Model
        • Prototyping Model
        • Incremental Process Model
      • Interview Questions
        • Software Testing Interview Questions
        • Automation Testing Interview Questions
        • Manual Testing Interview Questions
        • Software Engineering Interview Questions
        • Penetration Testing Interview Questions
        • API Testing Interview Questions
    • Databases
      • DBMS Tutorial
      • SQL Tutorial
      • PostgreSQL Tutorial
      • MongoDB Tutorial
      • SQL Interview Questions
      • MySQL Interview Questions
      • PL/SQL Interview Questions
    • Android
      • Android Tutorial
      • Android Studio Tutorial
      • Kotlin For Android
      • Android Projects
      • Android Interview Questions
      • 6 Weeks of Android App Development
    • Excel
      • MS Excel Tutorial
      • Introduction to MS Excel
      • Data Analysis in Excel
      • Basic Excel Formulas & Functions
      • Data Analysis in Advanced Excel
      • Workbooks
      • Statistical Functions
      • Data Visualization in Excel
      • Pivot Tables in Excel
      • Excel Spreadsheets in Python
      • Basic Excel Shortcuts
    • Mathematics
      • Number System
      • Algebra
      • Linear Algebra
      • Trigonometry
      • Set Theory
      • Statistics
      • Probability
      • Geometry
      • Mensuration
      • Logarithms
      • Calculus
    • Commerce
      • Business Studies
      • Accountancy
      • Microeconomics
      • Statistics for Economics
      • Macroeconomics
      • Human Resource Management (HRM)
      • Management
      • Income Tax
      • Finance
      • Commerce Complete Guide
    • SEO-Search Engine Optimization
      • What is SEO
      • Search Engine Optimization Basics
      • Types of SEO
      • Keyword Optimization in SEO
      • Backlinks in SEO
      • SEO Blogs
      • Mobile SEO
      • SEO Complete Reference
    • Aptitude
      • Aptitude Question and Answers
      • Quantitative Aptitude
      • Logical Reasoning
      • Verbal Ability
  • Data Science
    • Python Tutorial
    • R Tutorial
    • Machine Learning
    • Data Science using Python
    • Data Science using R
    • Data Science Packages
      • Pandas Tutorial
      • NumPy Tutorial
    • Data Visualization
      • Python Data Visualization Tutorial
      • Data Visualization with R
    • Data Analysis
      • Data Analysis with Python
      • Data Analysis with R
    • Deep Learning
    • NLP Tutorial
  • Web Dev
    • HTML Tutorial
    • CSS Tutorial
    • JavaScript Tutorial
    • PHP Tutorial
    • ReactJS Tutorial
    • NodeJS Tutorial
    • AngularJS
    • JSON
    • Cheat Sheets
      • HTML Cheat Sheet
      • CSS Cheat Sheet
      • JavaScript Cheat Sheet
      • React Cheat Sheet
      • Angular Cheat Sheet
      • jQuery Cheat Sheet
      • Bootstrap Cheat Sheet
    • Web Design
    • Web Browsers
      • Google Chrome
      • Mozilla Firefox
      • Apple Safari
      • Microsoft Edge
      • Tor
  • Home
  • Saved Videos
  • Courses
    • Data Structures and Algorithms

      • DSA Tutorial
      • Data Structures Tutorial
      • Algorithms Tutorial
      • Top 100 DSA Interview Questions
      • DSA-Roadmap[Basic-to-Advanced]

      ML & Data Science

      • Learn Python
      • Data Science Tutorial
      • Machine Learning Tutorial
      • Deep Learning Tutorial
      • NLP Tutorial
      • Computer Vision Tutorial

      Web Development

      • HTML Tutorial
      • CSS Tutorial
      • JavaScript Tutorial
      • ReactJS Tutorial
      • NodeJS Tutorial

      Languages

      • C
      • C++
      • Java
      • R Tutorial
      • Golang

      Interview Corner

      • Company Interview Corner
      • Experienced Interviews
      • Internship Experiences
      • Practice Company Questions
      • Competitive Programming

      CS Subjects

      • Operating Systems
      • DBMS
      • Computer Networks
      • Software Engineering
      • Software Testing

      Jobs

      • Get Hired: Apply for Jobs
      • Job-a-thon: Hiring Challenge
      • Corporate Hiring Solutions

      Practice

      • All DSA Problems
      • Problem of the Day
      • GFG SDE Sheet
      • Beginner's DSA Sheet
      • Love Babbar Sheet
      • Top 50 Array Problems
      • Top 50 String Problems
      • Top 50 DP Problems
      • Top 50 Graph Problems
      • Top 50 Tree Problems

      Contests

      • World Cup Hack-A-Thon
      • GFG Weekly Coding Contest
      • Job-A-Thon: Hiring Challenge
      • BiWizard School Contest
      • All Contests and Events
    • GBlog
    • Puzzles
    • What's New ?
    • Trending Now
    • Data Structures & Algorithms
    • Foundational Courses
    • Data Science
    • Practice Problem
    • Python
    • Machine Learning
    • Django
    • DevOps Tutorial
    • Java
    • JavaScript
    • C
    • C++
    • System Design
    • ReactJS
    • NodeJS
    • Web Development
    • Web Design
    • Web Browser
    • CP Live
    • Aptitude
    • Puzzles
    • Projects
    • Explore Our Geeks Community
    • Java Tutorial
    • Overview of Java

      • Introduction to Java
      • The Complete History of Java Programming Language
      • C++ vs Java vs Python
      • How to Download and Install Java for 64 bit machine?
      • Setting up the environment in Java
      • How to Download and Install Eclipse on Windows?
      • JDK in Java
      • How JVM Works - JVM Architecture?
      • Differences between JDK, JRE and JVM
      • Just In Time Compiler
      • Difference between JIT and JVM in Java
      • Difference between Byte Code and Machine Code
      • How is Java platform independent?

      Basics of Java

      • Java Basic Syntax
      • Java Hello World Program
      • Java Data Types
      • Primitive data type vs. Object data type in Java with Examples
      • Java Identifiers
      • Operators in Java
      • Java Variables
      • Scope of Variables In Java
      • Wrapper Classes in Java

      Input/Output in Java

      • How to Take Input From User in Java?
      • Scanner Class in Java
      • Java.io.BufferedReader Class in Java
      • Difference Between Scanner and BufferedReader Class in Java
      • Ways to read input from console in Java
      • System.out.println in Java
      • Difference between print() and println() in Java
      • Formatted Output in Java using printf()
      • Fast I/O in Java in Competitive Programming

      Flow Control in Java

      • Decision Making in Java (if, if-else, switch, break, continue, jump)
      • Java if statement with Examples
      • Java if-else
      • Java if-else-if ladder with Examples
      • Loops in Java
      • For Loop in Java
      • Java while loop with Examples
      • Java do-while loop with Examples
      • For-each loop in Java
      • Continue Statement in Java
      • Break statement in Java
      • Usage of Break keyword in Java
      • return keyword in Java

      Operators in Java

      • Java Arithmetic Operators with Examples
      • Java Unary Operator with Examples
      • Java Assignment Operators with Examples
      • Java Relational Operators with Examples
      • Java Logical Operators with Examples
      • Java Ternary Operator with Examples
      • Bitwise Operators in Java

      Strings in Java

      • Strings in Java
      • String class in Java
      • Java.lang.String class in Java | Set 2
      • Why Java Strings are Immutable?
      • StringBuffer class in Java
      • StringBuilder Class in Java with Examples
      • String vs StringBuilder vs StringBuffer in Java
      • StringTokenizer Class in Java
      • StringTokenizer Methods in Java with Examples | Set 2
      • StringJoiner Class in Java

      Arrays in Java

      • Arrays in Java
      • Arrays class in Java
      • Multidimensional Arrays in Java
      • Different Ways To Declare And Initialize 2-D Array in Java
      • Jagged Array in Java
      • Final Arrays in Java
      • Reflection Array Class in Java
      • util.Arrays vs reflect.Array in Java with Examples

      OOPS in Java

      • Object Oriented Programming (OOPs) Concept in Java
      • Why Java is not a purely Object-Oriented Language?
      • Classes and Objects in Java
      • Naming Conventions in Java
      • Java Methods
      • Access Modifiers in Java
      • Java Constructors
      • Four Main Object Oriented Programming Concepts of Java
      • Inheritance in Java
      • Abstraction in Java
      • Encapsulation in Java
      • Polymorphism in Java
      • Interfaces in Java
      • 'this' reference in Java

      Inheritance in Java

      • Inheritance and Constructors in Java
      • Java and Multiple Inheritance
      • Interfaces and Inheritance in Java
      • Association, Composition and Aggregation in Java
      • Comparison of Inheritance in C++ and Java

      Abstraction in Java

      • abstract keyword in java
      • Abstract Class in Java
      • Difference between Abstract Class and Interface in Java
      • Control Abstraction in Java with Examples
      • Difference Between Data Hiding and Abstraction in Java

      Encapsulation in Java

      • Difference between Abstraction and Encapsulation in Java with Examples

      Polymorphism in Java

      • Difference between Inheritance and Polymorphism
      • Dynamic Method Dispatch or Runtime Polymorphism in Java
      • Difference between Compile-time and Run-time Polymorphism in Java

      Constructors in Java

      • Copy Constructor in Java
      • Constructor Overloading in Java
      • Constructor Chaining In Java with Examples
      • Private Constructors and Singleton Classes in Java

      Methods in Java

      • Static methods vs Instance methods in Java
      • Abstract Method in Java with Examples
      • Overriding in Java
      • Method Overloading in Java
      • Difference Between Method Overloading and Method Overriding in Java

      Interfaces in Java

      • Differences between Interface and Class in Java
      • Functional Interfaces in Java
      • Nested Interface in Java
      • Marker interface in Java
      • Comparator Interface in Java with Examples

      Wrapper Classes in Java

      • Need of Wrapper Classes in Java
      • Different Ways to Create the Instances of Wrapper Classes in Java
      • Character Class in Java
      • Java.Lang.Byte class in Java
      • Java.Lang.Short class in Java
      • Java.lang.Integer class in Java
      • Java.Lang.Long class in Java
      • Java.Lang.Float class in Java
      • Java.Lang.Double Class in Java
      • Java.lang.Boolean Class in Java
      • Autoboxing and Unboxing in Java
      • Type conversion in Java with Examples

      Keywords in Java

      • Java Keywords
      • Important Keywords in Java
      • Super Keyword in Java
      • final Keyword in Java
      • static Keyword in Java
      • enum in Java
      • transient keyword in Java
      • volatile Keyword in Java
      • final, finally and finalize in Java

      Access Modifiers in Java

      • Public vs Protected vs Package vs Private Access Modifier in Java
      • Access and Non Access Modifiers in Java

      Memory Allocation in Java

      • Java Memory Management
      • How are Java objects stored in memory?
      • Stack vs Heap Memory Allocation
      • How many types of memory areas are allocated by JVM?
      • Garbage Collection in Java
      • Types of JVM Garbage Collectors in Java with implementation details
      • Memory leaks in Java
      • Java Virtual Machine (JVM) Stack Area

      Classes of Java

      • Understanding Classes and Objects in Java
      • Singleton Method Design Pattern in Java
      • Object Class in Java
      • Inner Class in Java
      • Throwable Class in Java with Examples

      Packages in Java

      • Packages In Java