What Are Regular Expressions in Java? In Java, Regex or Regular Expression is an Application Program Interface that helps in defining a pattern in order to search, manipulate and edit strings. Java regular expressions are widely used in the validation of passwords and emails. These expressions are provided by java.util.regex package and consists of 1 interfaceContinue Reading

Basics of Java Serialization. What is the concept of Java serialization? Answer: Java serialization is the process of turning an object into a stream of bytes or byte array. The byte array represents the class of the object, the version of the object, and the internal state of the object. WhatContinue Reading

What is multithreading in Java? Java multithreading enables the execution of multiple threads simultaneously. It allows a process to run its tasks in parallel mode on a single processor system. Now one question you may ask that what made this concept so famous. To get clarity, let’s see some ofContinue Reading

Java 5 introduced generic collections. The generic collections are more flexible and they are the preferred way to work with data. Generic collections enhance code reuse, type safety, and performance. There are many classes in the collection framework. Some of them, like ArrayBlockingQueue or IdentityHashMap, are specialized containers used in specific situations. WeContinue Reading

During the execution of our application many things might go wrong. A disk might get full and we cannot save our data. An Internet connection might go down while our application tries to connect to a site. A user fills invalid data to a form. These errors can crash theContinue Reading

What are Strings? A string in literal terms is a series of characters. Hey, did you say characters, isn’t it a primitive data type in Java. Yes, so in technical terms, the basic Java String is basically an array of characters. So my above string of “ROSE” can be representedContinue Reading

A package is a grouping of related types providing access protection and name space management. Packages in Java is a similar concept to namespaces in C#. Creating a package in Java A package is declared with the package keyword. This statement must be placed at the top of every source file. ThereContinue Reading

Final keyword in Java can be applied to a Variable, Method or Class. Java keeps restrictions on those, that are declared final. In this tutorial, we shall learn about the final keyword, and its usage, with the help of illustrative example programs. Final keyword in Java Final keyword in Java canContinue Reading

Encapsulation is one of the four key concepts in OOPS (Object Oriented Programming) namely Inheritance, Encapsulation, Abstraction and Polymorphism. Following definition helps you to understand the concept of encapsulation: Encapsulation is a process of hiding the data from the users or in other words we can say it protects the code by preventingContinue Reading

An Interface in JAVA is able to achieve 100% abstraction as it only contains those methods which has no implementation (i.e. methods without body). In other words we can say interface can only contain method signature and fields. Starting JAVA 8 default and static methods can have implementation in theContinue Reading