Arjun Thakur has Published 1109 Articles

Search elements in a sorted object array in Java

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 12:38:00

152 Views

An element can be searched in a sorted object array in Java by using the methodjava.util.Arrays.binarySearch(). This method returns the index of the required element if it is available in the array, otherwise it returns (-(insertion point) - 1) where the insertion point is the position at which the element ... Read More

Catalan numbers in java

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 12:25:10

398 Views

The nth Catalan number in terms of binomial coefficients is calculated by the formula(n + k )/k where k varies from 2 to n and n ≥ 0. i.e.Cn = (2n)!/((n+1)!n!)Programpublic class CatalanNumbers {    public static long fact(int i) {       if(i

Java Program to sort an array in case-sensitive order

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 12:19:25

304 Views

An array can be sorted in case-sensitive order using the java.util.Arrays.sort() method. Only a single argument required in this case for this method i.e. the array to be sorted. A program that demonstrates this is given as follows −Example Live Demoimport java.util.Arrays; public class Demo {    public static void main(String ... Read More

Filling byte array in Java

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 12:13:46

3K+ Views

The byte array in Java can be filled by using the method java.util.Arrays.fill(). This method assigns the required byte value to the byte array in Java. The two parameters required for java.util.Arrays.fill() are the array name and the value that is to be stored in the array elements.A program that ... Read More

Check if a large number is divisible by 3 or not in java

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 12:05:58

5K+ Views

If the sum of the digits of a number is divisible by 3, then the number is divisible by 3.Some examples of numbers divisible by 3 are as follows.The number 85203 is divisible by 3 because the sum of its digits (8 + 5 + 2 + 0 + 3 ... Read More

To check divisibility of any large number by 9 in java

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 12:01:29

830 Views

If the sum of the digits of a number is divisible by 9, then the number is divisible by 9.Some examples of numbers divisible by 9 are as follows. The number 51984 is divisible by 9 because the sum of its digits (5+ 1 + 9 + 8 + 4 = ... Read More

Align flex items at the beginning of the container with CSS

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 11:49:09

103 Views

Use the justify-content property with value flex-start to align the flex-items at the beginning.You can try to run the following code to implement the flex-start valueExampleLive Demo                    .mycontainer {             display: flex;     ... Read More

Shadow Filter with CSS

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 11:44:27

364 Views

Shadow filter is used to create an attenuated shadow in the direction and color specified.The following parameters can be used in this filterParameterDescriptionColorThe color that you want the shadow to be.DirectionThe direction of the blur, going clockwise, rounded to 45-degree increments. The default value is 270 (left).0 = Top45 = ... Read More

Animate border-left property with CSS

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 11:34:29

343 Views

To implement animation on border-left property with CSS, you can try to run the following codeExampleLive Demo                    div {             width: 500px;             height: 300px;           ... Read More

MySQL always returning the bit values as blank? How to get the original values?

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 11:17:50

241 Views

To get the original value, use the following syntax −Syntaxselect yourBitColumnName+0 from yourTableName;The above syntax cast the bit column to an integer. To understand the above concept, let us create a table and check how the returning value is blank. We will also see how to get the original value.The ... Read More

Advertisements