Skip to content

Category Archives: Java

A thread in Java at any point of time exists in any one of the following states. A thread lies only in one of the… Read More
Java provides functions to move files between directories. Two ways to achieve this are described here. The first method utilizes Files package for moving while… Read More
Prerequisites: Nested Classes in Java  Local Inner Classes are the inner classes that are defined inside a block. Generally, this block is a method body.… Read More
Prerequisite: Singleton Pattern In this article, we will see that what are various concepts which can break singleton property of a class and how to… Read More
Prerequisite – Java Constructors 1) What is the output of the following program? class Helper {     private int data;     private Helper()     {         data = 5;… Read More
In Java, there are three methods to print exception information. All of them are present in the Throwable class. Since Throwable is the base class… Read More
The answer to this question depends on the version of java you are using. Prior to JDK 7, the main method was not mandatory in… Read More
Java provides methods to delete files using java programs. On the contrary to normal delete operations in any operating system, files being deleted using the… Read More
Prerequisite: StringJoinerStringJoiner is very useful, when you need to join Strings in a Stream. Task : Suppose we want the string “[George:Sally:Fred]”, where we have given… Read More
StringJoiner is a class in java.util package is used to construct a sequence of characters(strings) separated by a delimiter and optionally starting with a supplied… Read More
Java provides built-in support for multithreaded programming. A multi-threaded program contains two or more parts that can run concurrently. Each part of such a program… Read More
Given a string, remove all the leading and trailing spaces from the string and return it. Examples: Input : str = " Hello World "… Read More
Many websites use small strings of text known as cookies to store persistent client-side state between connections. Cookies are passed from server to client and… Read More
The switch statement is a multi-way branch statement. It provides an easy way to dispatch execution to different parts of code based on the value… Read More
The switch statement is a multi-way branch statement. It provides an easy way to dispatch execution to different parts of code based on the value… Read More

Start Your Coding Journey Now!