Samual Sam has Published 2310 Articles

What is the smallest datatype for one bit in MySQL?

Samual Sam

Samual Sam

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

187 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

185 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

112 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

How to keep the insertion order with Java LinkedHashMap?

Samual Sam

Samual Sam

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

225 Views

To keep the insertion order with LinkedHashMap, use Iterator. Let us first create a HashMap and add elements to it −LinkedHashMaplHashMap = new LinkedHashMap(); lHashMap.put("1", "A"); lHashMap.put("2", "B"); lHashMap.put("3", "C"); lHashMap.put("4", "D"); lHashMap.put("5", "E"); lHashMap.put("6", "F"); lHashMap.put("7", "G"); lHashMap.put("8", "H"); lHashMap.put("9", "I");Now, get the values with the values() method. Iterate ... Read More

How to achieve case sensitive uniqueness and case insensitive search in MySQL?

Samual Sam

Samual Sam

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

1K+ Views

You can achieve case sensitive uniqueness and case insensitive search with the help of the following two ways −VARBINARY data type_bin collationVARBINARY data typeTo work with the VARBINARY data type, let us first create a table. The query to create a table is as follows −mysql> create table SearchingDemo2 ... Read More

LocalTime toString() method in Java

Samual Sam

Samual Sam

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

860 Views

The string value of the LocalTime object can be obtained using the method toString() in the LocalTime class in Java. This method requires no parameters and it returns the string value of the LocalTime object.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Demo { ... Read More

Java Program to read map by Map.Entry

Samual Sam

Samual Sam

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

177 Views

To read the Map, first use getProperties() ad then iterator to iterate through the entire list of Map −Properties prop = System.getProperties(); Iterator i = prop.entrySet().iterator();Now, loop through Map.Entry and get the key-value pair for the Map −while (i.hasNext()) {    Map.Entry entry = (Map.Entry) i.next();    System.out.println(entry.getKey() + " ... Read More

Provider getProperty() method in Java

Samual Sam

Samual Sam

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

312 Views

A specific key can be used to search for the required property in the property list using the method getProperty() in the class java.security.Provider. This method requires a single parameter i.e. the key required to search for the property. It returns the property value for the key or returns null ... Read More

LocalTime withNano() method in Java

Samual Sam

Samual Sam

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

77 Views

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

Global memory management in C++ : Stack or Heap?

Samual Sam

Samual Sam

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

2K+ Views

Stack and heap are used to store variables during the execution of the program and it also get destroyed.Global data structures or global variables are not consumed by stack or heap. They basically allocated in a fixed memory block, which remains unchanged.int a[10]; // located in a fixed memory block ... Read More

Advertisements