Home » Author Archives: Prasad Saya (page 2)

Author Archives: Prasad Saya

Prasad Saya
Prasad Saya is a software engineer with over ten years’ experience in application development, maintenance, testing and consulting on various platforms. He is a certified Java and Java EE developer. At present his interest is in developing Java applications. He also has experience working with databases and ERP applications.

javax.sql.rowset.JdbcRowSet Example

This article introduces the JdbcRowSet interface and its basic usage. This class is defined in the javax.sql.rowset package. JdbcRowSet interface extends RowSet (and Rowset extends ResultSet). A Jdbc rowset: It is a connected rowset. It is a wrapper around a ResultSet object; an enhanced ResultSet object. It maintains a connection to its data source, just as a ResultSet object does. ...

Read More »

java.lang.Iterable Interface Example

This article shows an example of Iterable interface. This is defined in java.lang package and was introduced with Java 5. The Iterable is defined as a generic type; Iterable<T>, where T type parameter represents the type of elements returned by the iterator. An object that implements this interface allows it to be the target of the “foreach” statement. The for-each ...

Read More »

Generic Classes in Java Example

This article shows creating a generic class. Java generics were introduced with Java SE version 5. Some commonly used generic classes are defined as collections in Java API; for example the ArrayList. The API javadoc documentation shows the ArrayList definition as public class ArrayList<E> (where E stands for an element type). Generics added the compile-time type safety and eliminated the ...

Read More »

java.nio.Buffer Example

This article introduces the Buffer class and its basic usage. This class is defined in the java.nio package. A buffer is a container for a fixed amount of data of a specific primitive type. There is one subclass of this class for each primitive type, except boolean. They are ByteBuffer, CharBuffer, DoubleBuffer, FloatBuffer, IntBuffer, LongBuffer and ShortBuffer classes. These are ...

Read More »

java.nio.channels.Selector Example

This example shows the basic usage of Selector. This is an abstract class defined in the java.nio.channels package. Selector is a multiplexor of SelectableChannel objects. NOTE: From the thefreedictionary.com a data-multiplexer is defined as a multiplexer that permits two or more data sources to share a common transmission medium. Multiplexed, non-blocking I/O, which is much more scalable than thread-oriented, blocking ...

Read More »

org.apache.commons.beanutils.converters.ArrayConverter Example

This article introduces the ArrayConverter class of the org.apache.commons.beanutils.converters package and its basic usage. This is defined in the Apache Commons BeanUtils 1.9.2 API. ArrayConverter is generic Converter implementation that handles conversion to and from array objects. The main features of this implementation are to convert: Individual elements of an array by delegating to a converter of appropriate type. From ...

Read More »

java.util.regex.Pattern Example

Pattern class represents a compiled representation of a regular expression. This is defined in the java.util.regex package as a final class. A regular expression is specified as a string. This string is to be first compiled into an instance of this class using the Pattern.compile() static method. This instance is used by a Matcher class to perform match operation. This ...

Read More »

Java Direct ByteBuffer Example

This example shows the usage of direct ByteBuffer. ByteBuffer is an abstract class, extends Buffer and implements Comparable<ByteBuffer>. This class is defined in the java.nio package. A buffer is a container for a fixed amount of data of a specific primitive type. There is a buffer class for each non-boolean primitive type. A ByteBuffer is a sub class of Buffer ...

Read More »

java.nio.channels.ScatteringByteChannel Example

ScatteringByteChannel is an interface extends ReadableByteChannel and is defined in java.nio.channels package. This is a channel that can read bytes into a sequence of buffers. This interface defines two read methods. read(ByteBuffer [] dsts): Reads a sequence of bytes from this channel into the given buffers. read(ByteBuffer [] dsts, int offset, int length): Reads a sequence of bytes from this ...

Read More »

org.apache.commons.io.comparator.DirectoryFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. DirectoryFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by directories and files. The File class’s isDirectory() method is used for comparing two files. This article shows ...

Read More »