logoNEURAL COOK
SearchAll PostsTagsNotesAuthor
logoNEURAL COOK

A posts created with Next.js and Tailwind.css

Explore

  • All posts
  • Notes
  • Snippets
  • Tags
  • RSS feed

Connect

instagramtwitterfacebookyoutubelinkedinmailgithub

© 2026 VIKI. All rights reserved.

Built with
Contents
Java/JVM architectureJava Collections : A Complete Guide for DSAJava Object Anatomy: What lives in Memory?The Java Dev Environment That Just WorksJava Utility MethodUnderstanding the Servlet Ecosystem: From Tomcat to Micronaut
DNSHTTPIP AddressThe Comprehensive DNS Master Guide: Architecture, Protocol, and GovernanceThe OSI Reference Model: A Comprehensive GuideThe TCP/IP Stack: The Architecture of the Internet
LogsExamplesResources
Miscellaneous/java

Java Utility Method

1 min read
On this pageCollections
CollectionsArraysStringBuilder

# Collections

Java provides the Collections utility class for common operations.

Collections.sort(list);
Collections.reverse(list);
Collections.max(list);
Collections.min(list);
Collections.frequency(list, value);

# Arrays

For arrays, use Arrays:

Arrays.sort(arr);
Arrays.binarySearch(arr, target);
Arrays.fill(dp, -1);

For immutable or fixed-size collections:

  • Arrays.asList() returns a fixed-size list backed by the array.
  • List.of() returns an unmodifiable list.
List<Integer> fixed = Arrays.asList(1, 2, 3);
List<Integer> immutable = List.of(1, 2, 3);

# StringBuilder

Efficient string construction

StringBuilder sb = new StringBuilder();
sb.append("hello");
sb.reverse();
←PreviousThe Java Dev Environment That Just WorksNext→Understanding the Servlet Ecosystem: From Tomcat to Micronaut

On this page

CollectionsArraysStringBuilder