All Easy Articles
Given a number “n”, find if it is Disarium or not. A number is called Disarium if sum of its digits powered with their respective… Read More
Given a number n, the task is to check whether it can be expressed as a sum of two or more consecutive numbers or not. Example… Read More
In Java, Exception Handling is one of the effective means to handle runtime errors so that the regular flow of the application can be preserved.… Read More
Given a string “str” and another string “sub_str”. We are allowed to delete “sub_str” from “str” any number of times. It is also given that… Read More
Given a string S having lowercase alphabets, the task is to check if all distinct characters in S occurs same number of times by removing… Read More
Difficulty level : Intermediate Predict the output of following Java Programs. Program 1 : public class Calculator {     int num = 100;     public void calc(int… Read More
TreeSet is one of the most important implementations of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements… Read More
You are given a number n ( 3 <= n < 10^6 ) and you have to find nearest prime less than n? Examples:  Input… Read More
Difficulty level : Intermediate Predict the output of following Java Programs. Program 1: class First {     public First() {  System.out.println("a"); } }    class Second extends… Read More
Given a number n find the smallest number evenly divisible by each number 1 to n.Examples:   Input : n = 4 Output : 12 Explanation… Read More
Given a limit, find the sum of all the even-valued terms in the Fibonacci sequence below given limit.The first few terms of Fibonacci Numbers are,… Read More
Today we are going to discuss the simplest way to print the array as a string in Java: Arrays.toString() method.  How to use Arrays.toString() method? … Read More
Given a value n, find the n’th even Fibonacci Number.Examples :   Input : n = 3 Output : 34 Input : n = 4 Output… Read More
Given a matrix M of size m x n ( 1 <= m,n <= 1000 ). It is initially filled with integers from 1 to… Read More
The reverseOrder() method of Collections class that in itself is present inside java.util package returns a comparator and using this comparator we can order the… Read More
shuffle() method of Collections class as the class name suggests is present in utility package known as java.util that shuffles the elements in the list.… Read More
Following methods can be used for converting ArrayList to Array: Method 1: Using Object[] toArray() method Syntax:  public Object[] toArray() It is specified by toArray… Read More
Predict the output of following Java program // Note static keyword after import. import static java.lang.System.*;     class StaticImportDemo {    public static void main(String args[])    {      … Read More
  java.util.Collections.sort() method is present in java.util.Collections class. It is used to sort the elements present in the specified list of Collection in ascending order.… Read More
The NavigableMap interface is a member of the Java Collection Framework. It belongs to java.util package and It is an extension of SortedMap which provides… Read More