/common-java-tasks

Solution of everyday Java problems.

Primary LanguageJava

Common Java Tasks


Contents:

- IO

... IN PROGRESS ...


Strings

Task Solution
Counting repeated characters. click
Finding the first non-repeating character. click
Inverting letters and words. click
Checking if a String value contains only digits. click
Counting vowels and consonants. click
Counting occurrences of a certain character click
Converting a String to int, long, float, or double. click
Removing whitespaces from String. click
Joining multiple Strings with custom delimiter. click
Generating all permutations String. click
Checking if a string is a palindrome. click
Removing duplicate characters. click
Removing specific character. click
Find the most frequently occurring character in a string. click
Sorting String array by length. click
Checking for a substring in a string. click
Counting the number of occurrences of a substring in a string. click
Checking if two strings are anagrams. click
Concatenating the same string n times. click
Finding the highest common prefix. click
Applying an indent. click
String transformation. click

Math

Task Solution
Finding extremes. click
Sum of big numbers. click
Next floating point value. click
Compact number formatting. click

Objects

Task Solution
Checking references for null. click
Checking indexes. click
Cloning objects. click

Date and time

Task Solution
Converting String to date. click
Getting the current date and time. click
Getting date and time units. click
Getting all time zones (UTC, GMT) click
UNIX timestamp conversion. click
Finding the first/last day of a month. click
Converting dates. click
Bypass date interval in a loop. click
Age calculation. click

LVTI (Local Variable Type Inference)

Task Solution
Simple use of var. click
Using the var type with primitive types. click

Arrays, Collections, and Data Structures

Task Solution
Array sort. click
Finding an element in an array. click
Checking the equivalence of arrays. click
Creating a stream from an array. click
Finding array extremes. click
Inverting an array. click
Filling and setting up an array. click
Resizing an array. click
Creation of immutable collections. click
Map compute and merge. click
Map sorting. click
Converting collection to Array. click
Thread-safe collections, stacks and queues. click
BFS (breadth-first search). click
Prefix tree (trie). click

IO

Task Solution
Creating file paths. click
Converting file paths. click
Connecting file paths. click
Relativize file paths. click
Walking file tree. click
Watching file paths. click
Streaming file. click
Search for files/directories. click

Reflection API

Task Solution
Package inspection. click
Class inspection. click
Class instance creation. click
Annotation inspection. click