Category «Java»

How to validate email, SSN, phone number in Java using Regular expressions.

Email

Regular Expressions offer a concise and powerful search-and-replace mechanism. They are patterns of characters used to perform search, extract or replace operations on the given text. Regular expressions can also be used to validate that the input conforms to a given format. For example, we can use Regular Expression to check whether the user input …

Java Utility for JDBC

Code re-usability is one of the many benefits of object oriented programming. For example, in Java if you need to perform email validation in different classes, rather than writing validation code in each class you can create email validation method in one class and then call that method from other classes. Now you have only …

Automatically Sort Vector Elements

Vector class in java.util package is very easy to use. You can add objects of any type in a vector. You don’t have to worry about declaring the size of the vector. You can just keep adding elements to your object and the vector will dynamically adjust the size. The vector will add elements one …