0% found this document useful (0 votes)
2 views2 pages

Java Predefined Methods Examples

This document provides a quick reference for predefined Java methods across various classes including String, Math, Arrays, Integer, Character, ArrayList, HashSet, and HashMap. Each class is accompanied by a list of commonly used methods. An example of sorting an array using the Arrays class is also included.

Uploaded by

i66922215
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Java Predefined Methods Examples

This document provides a quick reference for predefined Java methods across various classes including String, Math, Arrays, Integer, Character, ArrayList, HashSet, and HashMap. Each class is accompanied by a list of commonly used methods. An example of sorting an array using the Arrays class is also included.

Uploaded by

i66922215
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Java Predefined Methods - Quick Reference

String: length(), charAt(), substring(), equals(), contains(), indexOf(), toUpperCase(),


toLowerCase(), replace()
Math: abs(), max(), min(), sqrt(), pow(), ceil(), floor(), round(), random()
Arrays: sort(), binarySearch(), equals(), fill(), copyOf(), toString()
Integer: parseInt(), valueOf(), toString()
Character: isDigit(), isLetter(), isUpperCase(), isLowerCase()
ArrayList: add(), get(), set(), remove(), contains(), size(), clear()
HashSet: add(), remove(), contains(), size(), clear()
HashMap: put(), get(), remove(), containsKey(), containsValue()
Example
int[] arr = {0,5,3,2,8,1}; [Link](arr); Output: [0, 1, 2, 3, 5, 8]

You might also like