As we previously discussed, Java can create a thread in two ways, either through Thread class or Runnable Interface. Since, Runnable Interface consists a single… Read More
Program: public class Main { static int count = 0; String search; int len; String[] str; Main(String[] s,String srch){ str = s; search = srch;… Read More
Given an array 'arr' that may contain duplicate elements and we need to print distinct elements from that array. In other words, we need to… Read More
Program to replace a substring using replace method Simple Program: class Main { public static void main(String[] args) { String str = "newBay", replace="new"; String… Read More
Given a string str that may consist a sequence of characters and we need to replace a sub-string with a specific character sequence without using… Read More
Java supports three classes to operate on strings, String, StringBuffer and StringBuilder. The main difference between them is, String is immuatable, whereas StringBuffer & StringBuilder… Read More
Both TCP/IP Model and OSI Reference Model have layered architecture and also their functionality almost look similar. The main difference between them is, OSI reference… Read More
Both HDD and SSD are secondary storage devices used for the same purpose which is storing data or information. In terms of speed, size, performance,… Read More
A modem and router both are networking devices used for providing access to the internet. The main difference between them is, Modem connects your computer… Read More
The program prints Fibonacci triangle. A Fibonacci series is a series where each number is the sum of two immediate preceding numbers. For example ,… Read More