Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
Java
10.1k+ articles
Java - util package
1.5k+ articles
Java-Collections
1.1k+ articles
Java-time package
570+ articles
Java-lang package
380+ articles
java-basics
310+ articles
Java-text package
240+ articles
Java-IO package
240+ articles
Java-NIO package
220+ articles
Java-Time-Chrono package
160+ articles
Java-Functions
4.1k+ posts
Popular Articles
Recent Articles
Optional ifPresentOrElse() method in Java with examples
Last Updated: 30 July 2019
The ifPresentOrElse(Consumer, Runnable) method of java.util.Optional class helps us to perform the specified Consumer action the value of th
...read more
Java
Java - util package
Java-Functions
Java-Optional
Set add() method in Java with Examples
Last Updated: 24 May 2023
The add() method of Set in Java is used to add a specific element into a Set collection. The set add() function adds the element only if the
...read more
Misc
Java-Collections
Java-Functions
java-set
List add() Method in Java with Examples
Last Updated: 16 February 2024
The List add() method adds (appends) an element to a list. It can be used for both ArrayList and LinkedList.Example of List add() Method:[ta
...read more
Java
Java-Collections
Java - util package
Java-Functions
java-list
Similar Topics
Java
10.1k+ articles
Java - util package
1.5k+ articles
Java-Collections
1.1k+ articles
Java-time package
570+ articles
Java-lang package
380+ articles
java-basics
310+ articles
Java-text package
240+ articles
Java-IO package
240+ articles
Java-NIO package
220+ articles
Java-Time-Chrono package
160+ articles
Java HashMap computeIfAbsent() Method
Last Updated: 11 April 2025
In Java, the computeIfAbsent() method of the HashMap class is used to compute and insert a value for a specific key to a HashMap only if the
...read more
Java
Java-Collections
java-basics
Java - util package
Java-Functions
Java-HashMap
Collectors toMap() method in Java with Examples
Last Updated: 06 December 2018
The toMap() method is a static method of Collectors class which returns a Collector that accumulates elements into a Map whose keys and valu
...read more
Java
java-basics
Java - util package
Java-Functions
java-stream
Picked
Java-Stream-Collectors
Java-Collectors
Scanner nextInt() method in Java with Examples
Last Updated: 12 October 2018
The nextInt(radix) method of java.util.Scanner class scans the next token of the input as a Int. If the translation is successful, the scann
...read more
Java
Java-Library
Java - util package
Java-Functions
Collections swap() method in Java with Examples
Last Updated: 11 May 2021
The swap() method of java.util.Collections class is used to swap the elements at the specified positions in the specified list. If the speci
...read more
Java
Java-Collections
Java - util package
Java-Functions
Queue poll() method in Java
Last Updated: 20 October 2021
The poll() method of Queue Interface returns and removes the element at the front end of the container. It deletes the element in the contai
...read more
Java
Java-Collections
java-basics
Java - util package
Java-Functions
java-queue
Array get() Method in Java
Last Updated: 23 July 2020
The java.lang.reflect.Array.get() is an inbuilt method in Java and is used to return the element at a given index from the specified Array.S
...read more
Java
Java-Collections
Java - util package
Java-Arrays
Java-Functions
java-reflection-array
java-lang-reflect-package
Stack peek() Method in Java
Last Updated: 24 March 2025
The java.util.Stack.peek() method in Java is used to retrieve or fetch the first element of the Stack or the element present at the top of t
...read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
HashMap values() Method in Java
Last Updated: 26 November 2018
The java.util.HashMap.values() method of HashMap class in Java is used to create a collection out of the values of the map. It basically ret
...read more
Java
Java-Collections
Java - util package
Java-Functions
Java-HashMap
Stream.max() method in Java with Examples
Last Updated: 06 December 2018
Stream.max() returns the maximum element of the stream based on the provided Comparator. A Comparator is a comparison function, which impose
...read more
Misc
Java
Java - util package
Java-Functions
java-stream
Java-Stream interface
Stream sorted() in Java
Last Updated: 06 December 2018
Stream sorted() returns a stream consisting of the elements of this stream, sorted according to natural order. For ordered streams, the sort
...read more
Misc
Java
Java - util package
Java-Functions
java-stream
Java-Stream interface
Java String indexOf() Method
Last Updated: 19 November 2024
In Java, the String indexOf() method returns the position of the first occurrence of the specified character or string in a specified string
...read more
Strings
Java
Java-Strings
Java-Functions
Arrays copyOf() in Java with Examples
Last Updated: 11 November 2024
Arrays.copyOf() is a method ofjava.util.Arraysclass. It is used to copy the specified array, truncating or padding with false (for boolean a
...read more
Java
Java - util package
Java-Arrays
Java-Functions
First
1
2
3
4
5
6
7
8
>>
Last
First
1
2
3
4
5
6
>>
Last
First
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !