Java - Medium Articles
Object pool pattern is a software creational design pattern which is used in situations where the cost of initializing a class instance is very high. … Read More
Prerequisite : Exceptions in Java, Checked vs Unchecked Exceptions Exception propagation : An exception is first thrown from the top of the stack and if… Read More
Prerequisite: Equals() and hashCode() methods in Java HashMap and HashSet use hashing to manipulate data. They use hashCode() method to check hash values. The default… Read More
Given the input text file, read all mobile numbers present and write to some output file. Suppose we have a file names as input.txt and… Read More
Mobile Number validation criteria: The first digit should contain numbers between 6 to 9. The rest 9 digit can contain any number between 0 to… Read More
A Functional Interface is an Interface which allows only one Abstract method within the Interface scope. There are some predefined functional interface in Java like… Read More
Round 1: Place all numeric characters in string before alphabet characters . Using min swaps and O(1) space and Maintain the order of characters. Round… Read More
Java 7 has come up with a new class Objects that have 9 static utility methods for operating on objects. These utilities include null-safe methods… Read More
Given a number N, print the following pattern. Examples : Input : 4 Output : 4444444 4333334 4322234 4321234 4322234 4333334 4444444 Explanation: (1) Given… Read More
As know FTP is a reliable protocol used for transferring files over the Internet. Though it is not a secure protocol, and all the data… Read More
In Java Threads, if any thread is in sleeping or waiting state (i.e. sleep() or wait() is invoked), calling the interrupt() method on the thread,… Read More
Synchronization:  Synchronization is a modifier that is used for the method and blocks only. With the help of a synchronized modifier, we can restrict a… Read More
Every Java Programmer is familiar with NullPointerException. It can crash your code. And it is very hard to avoid it without using too many null… Read More
Given a URL as string, we need to find if the given URL is valid or not. Input : str = "https://www.geeksforgeeks.org/" Output : Yes… Read More
We are given the details of marks scored by students in form of a HashMap, where the name of the student is the Key and… Read More
We are given a 2D array of order N X M and a column number K ( 1<=K<=m). Our task is to sort the 2D… Read More
Morgan Stanley First Round : Telephonic round I was interviewing for Java developer post at Mumbai office of Morgan Stanley. Interview mostly consisted of multi-threading… Read More
In java, super keyword is used to access methods of the parent class while this is used to access methods of the current class. this… Read More
Prerequisite : Arrays in Java While working with arrays we have to do 3 tasks namely declaration, creation, initialization or Assignment. Declaration of array :… Read More
Find the output of the program Solution: If you run the program,you found that it prints X88. The first print statement prints X and the… Read More