Daniol Thomas has Published 212 Articles

The size() method of Java AbstractCollection class

Daniol Thomas

Daniol Thomas

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

141 Views

The size() method of the AbstractCollection class returns the numbers of elements in the collection. The method returns Integer.MAX_VALUE if the total number of elemnts in the collection exceeds the Interger.MAX_VALUE.The syntax is as follows:public abstract int size()To work with AbstractCollection class in Java, import the following package:import java.util.AbstractCollection;The following ... Read More

How to retrieve particular columns of a table using JDBC program?

Daniol Thomas

Daniol Thomas

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

5K+ Views

A ResultSet interface in JDBC represents the tabular data generated by SQL queries. It has a cursor which points to the current row. Initially this cursor is positioned before first row.You can move the cursor using the next() method and, you can retrieve the column values of a row using ... Read More

The addAll() method of Java AbstractSequentialList class

Daniol Thomas

Daniol Thomas

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

65 Views

The addAll() method of the AbstractSequentialList class inserts all the elements in the specified collection into this list at the specified position. Set the specified position as the parameter.The syntax is as follows:boolean addAll(int index, Collection

ArrayBlockingQueue toArray() Method in Java

Daniol Thomas

Daniol Thomas

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

61 Views

The toArray() method of the ArrayBlockingQueue class returns an array containing all of the elements in this queue.The syntax is as follows:Object[] toArray()To work with ArrayBlockingQueue class, you need to import the following package:import java.util.concurrent.ArrayBlockingQueue;The following is an example to implement toArray() method of Java ArrayBlockingQueue class:Example Live Demoimport java.util.ArrayList; import ... Read More

Create Ennead Tuple using with() method in Java

Daniol Thomas

Daniol Thomas

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

73 Views

To create Ennead Tuple, you can use the with() method. With that, you can also add elements to it. Let us first see what we need to work with JavaTuples. To work with Ennead class in JavaTuples, you need to import the following package:import org.javatuples.Ennead;Note: Download JavaTuples Jar library to ... Read More

LongStream findAny() method in Java

Daniol Thomas

Daniol Thomas

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

53 Views

The findAny() method of the LongStream class in Java returns an OptionalLong describing some element of the stream, or an empty OptionalLong if the stream is empty.The syntax is as follows:OptionalLong findAny()Here, OptionalLong is a container object which may or may not contain a long value.To use the LongStream class ... Read More

What is DatabaseMetaData in JDBC? What is its significance?

Daniol Thomas

Daniol Thomas

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

2K+ Views

Generally, Data about data is known as metadata. The DatabaseMetaData interface provides methods to get information about the database you have connected with like, database name, database driver version, maximum column length etc...Following are some methods of DatabaseMetaData class.MethodDescriptiongetDriverName()Retrieves the name of the current JDBC drivergetDriverVersion()Retrieves the version of the ... Read More

C++ Program to Perform Partition of an Integer in All Possible Ways

Daniol Thomas

Daniol Thomas

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

637 Views

Here is a C++ Program to get all the unique partitions of a given integer such that addition of a partition results an integer. In this program, a positive integer n is given, and generate all possible unique ways to represent n as sum of positive integers.AlgorithmBegin    function displayAllUniqueParts(int ... Read More

C++ Program to Implement the Bin Packing Algorithm

Daniol Thomas

Daniol Thomas

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

1K+ Views

The bin packing problem is a special type of cutting stock problem. In the bin packing problem, objects of different volumes must be packed into a finite number of containers or bins each of volume V in a way that minimizes the number of bins used. In computational complexity theory, ... Read More

What are the advantages of stored procedures?

Daniol Thomas

Daniol Thomas

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

3K+ Views

Following are the advantages of stored procedures:Since stored procedures are compiled and stored, whenever you call a procedure the response is quick.you can group all the required SQL statements in a procedure and execute them at once.Since procedures are stored on the database server which is faster than client. You ... Read More

Advertisements