Repeating a string using StringBuilder

Suppose you have the string ‘qwe’ and you need to repeat string ‘n’ times. Here’s how to do it with StringBuilder: Using StringBuilder and loop

Read More

How to parse JSON in Java

Google GSON library Let’s assume you have a class Book  with just a title.

Create maven project and add dependencies.

Then write this code to transform JSON into class: …

Read More

Writing forEach with java 8 lambda

Let’s take a simple example. It’s easier, probably, and can not be – create a list of numbers and display it on the screen through the simplest cycle:

Read More