Skip to content

Neo9Phoenix/JavaCollectionsPlayground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Collections Playground

JavaCollectionsPlayground

A simple Java program demonstrating the power of the Collections class with an ArrayList<Double> including sorting, binary searching, and filling lists with new values.


🧠 Features

  • Create and print an ArrayList<Double>
  • Sort the list using Collections.sort()
  • Search for a specific value with Collections.binarySearch()
  • Replace all list elements using Collections.fill()

⚙️ How to Run

Make sure Java 21 (or newer) is installed.
Then compile and run the program:

javac src\cop2805\CollectionsDouble.java
java -cp src cop2805.CollectionsDouble

🧾 Example Output

Original List: 1.5 2.35 -4.7 0.01

Sorted List: -4.7 0.01 1.5 2.35

Found 1.5 at index 2 Zero List: 0.0 0.0 0.0 0.0

About

Java Collections demo - sorting, searching, and filling ArrayLists using the Collections framework.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages