Samual Sam has Published 2310 Articles

ArrayBuffer.slice() function in JavaScript

Samual Sam

Samual Sam

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

519 Views

ArrayBuffer object in JavaScript represents a fixed-length binary data buffer.The slice() method of the this object returns a portion or, chunk from the array buffer (as a separate object). It accepts two integer arguments representing the start (inclusive) and end (exclusive) of the portion of the array to be returned.SyntaxIts ... Read More

Copy all elements of ArrayList to an Object Array in Java

Samual Sam

Samual Sam

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

3K+ Views

All the elements of an ArrayList can be copied into an Object Array using the method java.util.ArrayList.toArray(). This method does not have any parameters and it returns an Object Array that contains all the elements of the ArrayList copied in the correct order.A program that demonstrates this is given as ... Read More

Atomics.and() function in JavaScript

Samual Sam

Samual Sam

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

188 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 and() function of the Atomic object accepts a value representing the position of an array, performs bitwise ... Read More

Atomics.isLockFree() function in JavaScript

Samual Sam

Samual Sam

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

132 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.This method is used to determine whether to use locks or atomic operations.SyntaxIts syntax is as followsAtomics.isLockFree(size)Example Live Demo ... Read More

Atomics.store() function in JavaScript

Samual Sam

Samual Sam

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

155 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 store() function of the atomic object accepts a number(value) and a position in the array and, stores ... Read More

Remove all elements from a HashSet in Java

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:50:28

2K+ Views

To remove all the elements from HashSet, use the clear() method.Create a HashSet and initialize elements −String strArr[] = { "P", "Q", "R", "S" }; Set s = new HashSet(Arrays.asList(strArr));Now, to remove all the above elements −s.clear()The following is an example to remove all elements from a HashSet −Example Live Demoimport ... Read More

Get size of HashSet in Java

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:48:14

354 Views

To get the size of HashSet, use the size() method. Let us create a HashSet and add elements −Set hs = new HashSet(); hs.add(15); hs.add(71); hs.add(82); hs.add(89); hs.add(91);Let us now use size() and get the size of HashSet −hs.size()The following is an example to get the size of HashSet −Example Live ... Read More

Remove specified element from HashSet in Java

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:46:23

467 Views

To remove specified element from HashSet, use the remove() method.First, declare a HashSet and add elements −Set hs = new HashSet(); hs.add(20); hs.add(39); hs.add(67); hs.add(79); hs.add(81); hs.add(87); hs.add(88);Let’s say you need to remove element 39. For that, use the remove() method −hs.remove(39);The following is an example to remove specified element ... Read More

ArrayBuffer.byteLength Property in JavaScript

Samual Sam

Samual Sam

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

662 Views

ArrayBuffer object in JavaScript represents a fixed-length binary data buffer.The byteLength property of the ArrayBuffer returns an unsigned, 32-bit integer that specifies the size/length of the ArrayBuffer.SyntaxIts syntax is as followsarray.byteLengthExampleTry the following example. Live Demo JavaScript Example           var arrayBuffer = new ArrayBuffer(8); ... Read More

Perform Animation on CSS border-bottom-color property

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:35:50

112 Views

To implement animation on the border-bottom-color property with CSS, you can try to run the following code ExampleLive Demo    div {       width: 500px;       height: 400px;       background: yellow;       border: 10px solid yellow;       background-image: ... Read More

Advertisements