Explore Connect Documentation
Snippets

How to ... in Java 8

[CG]BOUGA
11.2K views
GitHub

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Java developers often face the same problems, like reading from a file or knowing if some value is in a list.

This article is a collection of solutions for these common tasks. This list is not exhaustive, feel free to contribute on Github.

Files

  • How to read a file
  • How to write to a file
  • How to list files in a directory
  • How to create a temporary file
  • How to copy a file

Collections

  • How to test if a List contains a specific value
  • How to apply a function on each element of a List

JSON

  • How to parse a String into a JSON object
  • How to format an Object into a JSON String

XML

  • How to parse a String into an XML document
  • How to format an Object into an XML String

HTTP

  • How to send an HTTP request

Email

  • How to send an email

Date

  • How to get the current date
  • How to format a date
  • How to parse a date String

Miscellaneous

  • How to encode/decode in base64
  • How to generate random integers/strings
  • How to hash
  • How to parse an URL
Suggested playgrounds

How to test if a List contains a specific value in Java

By
[CG]BOUGA
73.5K
8

How to apply a function on each element of a List in Java

By
[CG]BOUGA
26.9K
4

Programmieraufgabe 2

By
ferenc-hechler
180
0

Beginner Java Concepts

By
a-Rye
37.9K
221
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content