Skip to content

Category Archives: Java Programs

How to get the value of Environment variables? The System class in Java provides a method named System.getenv() which can be used to get the… Read More
A linked list L0 -> L1 -> L2 -> ….. -> LN can be folded as L0 -> LN -> L1 -> LN – 1… Read More
Given an integer array arr[], the task is to sort only those elements which are ugly numbers at their relative positions in the array (positions… Read More
Given string str, the task is to print the last character of each word in the string. Examples:   Input: str = “Geeks for Geeks” Output: s… Read More
Given the other two sides of a right angled triangle, the task is to find it’s hypotenuse.Examples:   Input: side1 = 3, side2 = 4 Output: 5.00 32… Read More
Given two integers n1 and n2, the task is to concatenate these two integers into one integer.Example:   Input: n1 = 12, n2 = 34 Output:… Read More
Given two numbers n and r, the task is to find the value of nPr. nPr represents n permutation r which is calculated as n!/(n-k)!. Permutation… Read More
Given an array arr[], the task is to find whether the array is mirror inverse. Inverse of an array means if the array elements are… Read More
This article shows how to perform concurrent programming using Java threading framework. Let’s analyze concurrent programming first: Concurrent Programming: This means that tasks appear to… Read More
There are different ways in which parameter data can be passed into and out of methods and functions. Let us assume that a function B()… Read More
Given an array of n integers. The task is to find the maximum length of the sub-array such that absolute difference between all the consecutive… Read More
Given a string str, the task is to print all the distinct permutations of str. A permutation is an arrangement of all or part of a… Read More
Given a keypad of a mobile, and keys that need to be pressed, the task is to print all the words which are possible to… Read More
Given an integer array marks, which comprises of marks scored by a student (out of 100) in different subjects, the task is to assign a… Read More
The mkdirs() method is a part of File class. The mkdirs() function is used to create a new directory denoted by the abstract pathname and… Read More

Start Your Coding Journey Now!