When you want to search for the dot (.) character in a regular expression and not use it as a metacharacter use the following syntax:
String regexPattern = “[.]”;→ Continue reading “Searcing for a dot "." character with a Java Regular Expression”
Principal Software Engineer/Architect, motorcyclist, drummer, and artist
When you want to search for the dot (.) character in a regular expression and not use it as a metacharacter use the following syntax:
String regexPattern = “[.]”;→ Continue reading “Searcing for a dot "." character with a Java Regular Expression”
With Java 5.0 enums became much more powerful, click here for an overview.
I am working on a project that is using an enum to keep track of an attribute of one of my objects and wanted to initialize a HashMap inline in the call to the enum’s constructor. Such was my delight to find out that using a simple initializer block that it was a snap.
Here is the relevant snippet of code that illustrates the syntax:
public → Continue reading “Java In-line Initialization of a Map in the Constructor of an Enum Constant”