Search Results for: java 8
-
class
Use the keyword this to call a constructor
In this example we shall show you how to use the keyword this to call a constructor in a class.…
Read More » -
class
Static Initialization Block example
In this example we shall show you how to use a static block for initialization of a classe’s fields. To…
Read More » -
regex
Get all digits from a string
With this example we are going to demonstrate how to get all digits from a String, using a regular expression.…
Read More » -
regex
Parse an Apache logfile with regular expressions
In this example we shall show you how to parse an Apache logfile with regular expressions. To parse an Apache…
Read More » -
regex
Word frequency count example
With this example we are going to demonstrate how to count the frequency of words in a file. In short,…
Read More » -
regex
Filter the content of a file using regular expressions
This is an example of how to filter the content of a file using regular expressions. Filtering the content of…
Read More » -
regex
Match address using regular expressions
This is an example of how to match an address using regular expressions. We have created a method boolean isValidAddr(String…
Read More » -
regex
Regular expressions for IP v4 and IP v6 addresses
In this example we shall show you how to check if an address is an IPv4 or IPv6 address, using…
Read More » -
synchronized
Synchronization with multiple locks
The basic idea is to use separate locks to guard multiple independent state variables of a class, instead of having…
Read More » -
synchronized
Synchronized method and block
The first level of synchronization is on method scope: public class HelloSync { private Map dictionary = new HashMap(); public…
Read More »