-
class
Simple use of the keyword this
With this example we are going to demonstrate how to use the keyword this. Within an instance method or a…
Read More » -
class
Inner class instance example
In this example we shall show you how to call an inner classe’s instance in a class. To call an inner…
Read More » -
class
Protected Keyword
This is an example of how to use the protected keyword in a class. In order to use the protected keyword,…
Read More » -
class
Java Overloading Methods
With this example we are going to demonstrate how to use Overloading Java Methods in a class. Overloaded methods are…
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 » -
class
List the interfaces a class implements
This is an example of how to list the interfaces that a class implements in Java. We are using the…
Read More » -
class
Get an object’s class name
With this example we are going to demonstrate how to get an object’s class name. We can get the class…
Read More » -
regex
Simple validation example
In this example we shall show you how to make a simple validation of a String, using a Matcher against…
Read More » -
regex
Determine if a string matches a pattern exactly
This is an example of how to determine if a String matches to a Pattern exactly. Using a Matcher to…
Read More » -
regex
Strip extra spaces in a string
With this example we are going to demonstrate how to strip extra spaces in a String. In short, to strip…
Read More »