What is an Environment Variable? An environment variable is a system variable, and any program can access it for various reasons, like locating the path of the program, user names etc., which you would like to make it accessible for all or specific program. An environment variable often named all in CAPS, for example PATH. Each environment variable contains a value in … [Read more...] about Get Environment Variables and System Properties in Java
Java
Binary Search
What is Binary Search? Binary search is the fast method of searching for an element in an array. In this approach, we need the array in sorted order. In Binary search, we first identify the center of the array by dividing the array size by 2. Then, we compare the search element with an element present at the center of the array. If the element at center matches with the … [Read more...] about Binary Search
Linear Search
A linear search is the simplest form of search in an array of elements. We can perform a linear search in three distinct ways based on the order of elements in an array. There can be three scenarios, elements are in ascending order, or descending order, or no order at all. If the array contains all the elements in ascending order, we'll search for the element in the … [Read more...] about Linear Search
LCM and GCD of Two Numbers in Java
LCM of Two Numbers in Java Let's start discussing how to find LCM of two numbers in Java. We can find LCM in 2 ways: (1) by iterating over a loop (2) by using GCD What is the Least Common Multiple (LCM)? Its definition is self-explanatory. If there are two numbers x and y, LCM is a positive number and the smallest of all the common multiples of both x and y. … [Read more...] about LCM and GCD of Two Numbers in Java
Temperature Conversions using Java
In this article, we'll see the temperature conversions between four different temperature scales named Fahrenheit, Celsius, Kelvin, and Rankine. Temperature Scales Fahrenheit Scale Fahrenheit scale was created by German scientist Daniel Gabriel FahrenheitAccording to this scale, water freezes at 32 degrees of Fahrenheit and boils at 212 degrees of FahrenheitSo it will … [Read more...] about Temperature Conversions using Java