Samual Sam has Published 2310 Articles

How to use putLast() in android LinkedBlockingDeque?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

130 Views

Before getting into example, we should know what LinkedBlockingDeque is. It is implemented by Collection interface and the AbstractQueue class. It provides optional boundaries based on linked nodes.It going to pass memory size to constructor and helps to provide memory wastage in android.This example demonstrate about How to use putLast ... Read More

LocalDate compareTo() method

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

4K+ Views

Two LocalDate objects can be compared using the compareTo() method in the LocalDate class in Java. This method requires a single parameter i.e. the LocalDate object to be compared.If the first LocalDate object is greater than the second LocalDate object it returns a positive number, if the first LocalDate object ... Read More

How to use remainingCapacity() in android PriorityBlockingQueue?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

159 Views

Before getting into the example, we should know what PriorityBlockingQueue is. It is an unbounded queue and follows the same order as a priority queue. The main usage of priority blocking queue is, it going to handle out of memory error.This example demonstrates about How to use remainingCapacity() in android ... Read More

Java Program to adjust Adjust LocalDate to first Day Of next month with TemporalAdjusters class

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

348 Views

Let us first set a date −LocalDate localDate = LocalDate.of(2019, Month.JUNE, 15);Now, adjust LocalDate to first Day of next month −LocalDate day = localDate.with(TemporalAdjusters.firstDayOfNextMonth());Example Live Demoimport java.time.LocalDate; import java.time.Month; import java.time.temporal.TemporalAdjusters; public class Demo {    public static void main(String[] args) {       LocalDate localDate = LocalDate.of(2019, Month.JUNE, 15); ... Read More

LocalDate from() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

118 Views

An instance of a LocalDate object can be obtained from a Temporal object using the from() method in the LocalDate class in Java. This method requires a single parameter i.e. the Temporal object and it returns the LocalDate object that is obtained from the Temporal object.A program that demonstrates this ... Read More

LocalDate format() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

98 Views

The LocalDate can be formatted with the specified formatter using the format() method in the LocalDate class in Java. This method requires a single parameter i.e. the LocalDate object to be formatted and it returns the formatted LocalDate with the specified formatter.A program that demonstrates this is given as follows ... Read More

How to use remove() in android CopyOnWriteArrayList?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

138 Views

Before getting into example, we should know what CopyOnWriteArrayList is. It is a thread-safe variant of ArrayList and operations add, set, and so on by making a fresh copy of the underlying array.This example demonstrate about How to use remove() in android CopyOnWriteArrayListStep 1 − Create a new project in ... Read More

Java Program to create random BigInteger within a given range

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

371 Views

Create a Random class object −Random random = new Random();Now let us create a random BigInteger within the range set below −BigInteger i = new BigInteger(1024, random);Example Live Demoimport java.math.BigInteger; import java.util.Random; public class Demo {    public static void main(String[] args) {       Random random = new Random(); ... Read More

DoubleBuffer wrap() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

133 Views

A double array can be wrapped into a buffer using the method wrap() in the class java.nio.DoubleBuffer. This method requires a single parameter i.e. the array to be wrapped into a buffer and it returns the new buffer created. If the returned buffer is modified, then the contents of the ... Read More

LocalDate getChronology() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

79 Views

The value of the specified field from the LocalDate can be obtained using the get() method in the LocalDate class in Java. This method requires a single parameter i.e. ChronoField that is required and it returns the value of the specified field from the LocalDate.A program that demonstrates this is ... Read More

Advertisements