Skip to content

Category Archives: Java Programs

Gson is a Java library that can be used to convert a JSON string to an equivalent Java object. Gson can work with arbitrary Java… Read More
Given a Double real number. Write a Java program to convert the given double number into a Long (long) in Java. Examples: Input: double =… Read More
Given non-negative integers K, M, and an array arr[ ] consisting of N elements, the task is to find the Mth element of the array… Read More
Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:… Read More
Given an array arr[], the task is to find the number of rotations required to convert the given array to sorted form.Examples: Input: arr[] =… Read More
Given an integer array arr[] of size N, the task is to print all possible rotations of the array.Examples:  Input: arr[] = {1, 2, 3,… Read More
Given a matrix mat[][] of size N*N, the task is to rotate the matrix by 45 degrees and print the matrix. Examples: Input: N =… Read More
Given two arrays arr1[] and arr2[] of N integers and array arr1[] has distinct elements. The task is to find the maximum count of corresponding… Read More
Java data types can be categorized as primitive and non-primitive. Primitive data types contain a single value, whereas non-primitive data types contain an address of… Read More
Given an array arr consisting of N elements and Q queries of the following two types:   1 K: For this type of query, the array… Read More
Given an integer X and two strings S1 and S2, the task is to check that string S1 can be converted to the string S2… Read More
Given two integers N and K, the task is to rotate the digits of N by K. If K is a positive integer, left rotate… Read More
Given two linked lists that represent two large positive numbers. Subtract the smaller number from the larger one and return the difference as a linked… Read More

Start Your Coding Journey Now!