How to get Current Date and Time in Java

Java provides two classes to get current date and time – Date and Calendar. Get Current Date in Java Here is the simple program showing how we can use these classes to get the current….

Java Date add days, subtract days, Calendar

Sometimes while working on Java Date, we need to add or subtract some days from it. Here I am providing java example to add days to java date or subtract days to java date object…..

How to convert Java Date into Specific TimeZone format

In the last example, we learned how to convert Date to String in Java. In this example, I am converting a Java Date object from one timezone to another. We will use SimpleDateFormat class to….

Convert String to Date, Date to String in Java

Sometimes we have to Convert String to Date in java program or convert Date to String in a different format for printing. Convert String to Date Here is a simple scenario where we will have….

Java FTP Client Upload Example – Apache Commons Net

Java FTP Client is used to upload files to FTP server. Recently I was working in a web project where I had to upload a lot of images to the FTP server. Few days back,….

Inheritance in Java Example

Inheritance in java is one of the core concepts of Object Oriented Programming. Java Inheritance is used when we have is-a relationship between objects. Inheritance in Java is implemented using extends keyword. Inheritance in Java….

Regular Expression Phone Number validation in Java

Validating a phone number using regular expression is tricky because the phone number can be written in many formats and can have extensions also. For example, here are some of the common way of writing….

Java email validation – email regex java

Today we will look into java email validation program. Sometimes we have to validate email address and we can use email regex for that. In the last post, I explained about java regular expression in….

Regular Expression in Java – Java Regex Example

Welcome to Regular Expression in Java. It’s also called Regex in Java. When I started programming, java regular expression was a nightmare for me. This tutorial is aimed to help you master Regular Expression in….

Java Catch Multiple Exceptions, Rethrow Exception

In Java 7, catch block has been improved to handle multiple exceptions in a single catch block. If you are catching multiple exceptions and they have similar code, then using this feature will reduce code….

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages