Karthikeya Boyini has Published 2192 Articles

Convert an ArrayList to an Array with zero length Array in Java

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 09:59:33

241 Views

An ArrayList can be converted into an Array using the java.util.ArrayList.toArray() method. This method takes a single parameter i.e. the array of the required type into which the ArrayList elements are stored and it returns an Array that contains all the elements of the ArrayList in the correct order.A program ... Read More

ArrayBuffer.isView() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 09:57:17

257 Views

ArrayBuffer object in JavaScript represents a fixed-length binary data buffer. The isView() function of this object accepts an argument and verifies whether it is view of ArrayBuffer (DataView, typed array). If so, it returns true else, it returns false.SyntaxIts syntax is as followsarrayBuffer.isView(arg)ExampleTry the following example. Live Demo    JavaScript ... Read More

Atomics.add() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 09:56:17

187 Views

The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The add() function of this object accepts a number and the position, adds the given number to the ... Read More

Atomics.or() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 09:55:16

151 Views

The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The or() function of the atomic object accepts a value representing the position of an array, performs bitwise ... Read More

Atomics.load() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 09:54:19

196 Views

The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The load() function of the Atomic object returns the value at a given position of an array.SyntaxIts syntax ... Read More

Atomics.sub() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 09:53:06

153 Views

The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The sub() function of the atomic object accepts a number and the position, subtracts the given number from ... Read More

Copy all elements of Java HashSet to an Object Array

karthikeya Boyini

karthikeya Boyini

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

333 Views

Declare a HashSet and add elements −Set hs = new HashSet(); hs.add(15); hs.add(71); hs.add(82); hs.add(89); hs.add(91); hs.add(93); hs.add(97); hs.add(99);To copy all the elements, use the toArray() method −Object[] obArr = hs.toArray();The following is an example to copy all elements to HashSet to an object array −Example Live Demoimport java.util.*; public class ... Read More

Iterate through elements of HashSet in Java

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 09:47:33

407 Views

Create a HashSet and add elements to it −Set hs = new HashSet(); hs.add(20); hs.add(39); hs.add(67); hs.add(79); hs.add(81); hs.add(87);Try the below given code to iterate through the elements −Iterator i = hs.iterator(); while (i.hasNext()) System.out.println(i.next());To iterate through the elements of HashSet, try the following code −Example Live Demoimport java.util.*; public class ... Read More

Iterate over the elements of HashSet in Java

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 09:45:39

311 Views

Declare a HashSet and add elements −Set hs = new HashSet(); hs.add(20); hs.add(39); hs.add(67); hs.add(79);Now, iterate over the elements −for (Iterator i = hs.iterator(); i.hasNext();) {    Object ele = i.next();    System.out.println(ele); }The following is an example that iterate over the elements of HashSet −Example Live Demoimport java.util.HashSet; import java.util.Iterator; ... Read More

How to preserve the readability when font fallback occurs with CSS

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 09:36:34

130 Views

Use the font-size-adjust property to preserve the readability when font fallback occurs. You can try to run the following code to implement the font-size-adjust propertyExampleLive Demo                    #demo {             font-size-adjust: 0.90;          }                     Heading Two       With font-size-adjust property:                This is demo text.             Without font-size-adjust property:       This is demo text.    

Advertisements