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

Java Non-Primitive Data Types Guide

The document outlines common operations for Java non-primitive data types, including Strings, Arrays, ArrayLists, HashMaps, and Custom Objects. Each section lists various methods and operations that can be performed on these data types, such as accessing elements, modifying values, and retrieving sizes. It provides a quick reference for Java developers to utilize these operations effectively.

Uploaded by

mnithishsarwin
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)
41 views2 pages

Java Non-Primitive Data Types Guide

The document outlines common operations for Java non-primitive data types, including Strings, Arrays, ArrayLists, HashMaps, and Custom Objects. Each section lists various methods and operations that can be performed on these data types, such as accessing elements, modifying values, and retrieving sizes. It provides a quick reference for Java developers to utilize these operations effectively.

Uploaded by

mnithishsarwin
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 Non-Primitive Data Types - Common Operations

1. String Operations

- length(): [Link]()

- charAt(): [Link](0)

- substring(): [Link](2)

- toUpperCase(): [Link]()

- toLowerCase(): [Link]()

- equals(): [Link]("Hi")

- concat(): [Link](" World")

- replace(): [Link]("a", "o")

- trim(): [Link]()

- split(): [Link](" ")

- indexOf(): [Link]("a")

2. Array Operations

- Access element: arr[0]

- Modify element: arr[2] = 99;

- Find length: [Link]

- Loop through: for (int x : arr)

- Sort array: [Link](arr)

- Copy array: [Link](arr, newLength)

- Fill array: [Link](arr, value)

3. ArrayList Operations

- add(): [Link]("A")

- get(): [Link](0)

- remove(): [Link](1)

- size(): [Link]()

- contains(): [Link]("A")

- clear(): [Link]()
Java Non-Primitive Data Types - Common Operations

- set(): [Link](0, "B")

- indexOf(): [Link]("A")

- isEmpty(): [Link]()

4. HashMap Operations

- put(): [Link]("key", "value")

- get(): [Link]("key")

- remove(): [Link]("key")

- containsKey(): [Link]("key")

- containsValue(): [Link]("value")

- keySet(): [Link]()

- values(): [Link]()

- entrySet(): [Link]()

- size(): [Link]()

5. Custom Object Operations

- Methods depend on what you define in your class.

Example:

- displayInfo(): [Link]()

- calculateMarks(): [Link]()

You might also like