Samual Sam has Published 2492 Articles

LocalTime withHour() method in Java

Samual Sam

Samual Sam

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

24 Views

An immutable copy of a LocalTime with the hour altered as required is done using the method withHour() in the LocalTime class in Java. This method requires a single parameter i.e. the hour that is to be set in the LocalTime and it returns the LocalTime with the hour altered ... Read More

Select timestamp as date string in MySQL?

Samual Sam

Samual Sam

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

212 Views

To select timestamp as date string in MySQL, the syntax is as follows −select FROM_UNIXTIME(yourColumnName, '%Y-%m-%d %H:%i:%s') from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table select_timestampDemo    -> (    -> Id int NOT NULL ... Read More

Duration getUnits() method in Java

Samual Sam

Samual Sam

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

62 Views

The list of different units that are supported by a duration can be obtained using the method getUnits() in the Duration class in Java. This method requires no parameters and it returns the list of different units that are supported by a duration.A program that demonstrates this is given as ... Read More

Replace an element from a Java List using ListIterator

Samual Sam

Samual Sam

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

237 Views

Let us first create a Java List and add elements −ArrayList < String > list = new ArrayList < String > (); list.add("Katie"); list.add("Tom"); list.add("Jack"); list.add("Amy"); list.add("Andre"); list.add("Brad"); list.add("Peter"); list.add("Bradley");Now, use ListIterator and return the next element in the List with next() −ListIteratoriterator = list.listIterator(); iterator.next();Replace the element in the ... Read More

Provider getVersion() method in Java

Samual Sam

Samual Sam

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

162 Views

The version number of the provider can be obtained using the method getVersion() in the class java.security.Provider. This method requires no parameter and it returns the version number of the provider as required.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo { ... Read More

Assumptions for Dynamic Channel Allocation

Samual Sam

Samual Sam

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

2K+ Views

Dynamic channel allocation are schemes for allotting shared network channels to competing users in a dynamic manner as per their requirements. The users may be base stations, access points or terminal equipment which are allotted channels from a central pool. There are a number of methods for dynamic channel allocation. ... Read More

Instant plusMillis() method in Java

Samual Sam

Samual Sam

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

125 Views

An immutable copy of a instant where some milliseconds are added to it can be obtained using the plusMillis() method in the Instant class in Java. This method requires a single parameter i.e. the number of milliseconds to be added and it returns the instant with the added milliseconds.A program ... Read More

What is the smallest datatype for one bit in MySQL?

Samual Sam

Samual Sam

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

113 Views

The smallest datatype for one bit can be bit(1). The syntax is as follows −yourColumnName bit(1)To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table bitDemo    -> (    -> isValid bit(1)    -> ); Query OK, ... Read More

Java Program to create String to super class type mapping

Samual Sam

Samual Sam

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

121 Views

Here, we have a superclass Vehicle and within that some subclasses −class Vehicle { } class Motorcycle extends Vehicle { } class Bus extends Vehicle { } class Car extends Vehicle { }Now, we will create some strings for mapping with super class type −Mapmap = new HashMap(); map.put("motorcycle", new ... Read More

Instant plusNanos() method in Java

Samual Sam

Samual Sam

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

71 Views

An immutable copy of a instant where some nanoseconds are added to it can be obtained using the plusNanos() method in the Instant class in Java. This method requires a single parameter i.e. the number of nanoseconds to be added and it returns the instant with the added nanoseconds.A program ... Read More

Advertisements