Java I/O: File Viewer Utility

Let’s write a utility called File Viewer that accepts the name of a character file on the command line and displays its contents to the user console....

David Miller
Java
 1098 View(s)

Java I/O: Character Streams and Buffered Reader/Writers

Just the way binary streams operate on binary files, the character streams operate on character files—that is, text files such as .txt, .odt, and .doc...

David Miller
Java
 1126 View(s)

Java I/O: The OutputStream Methods

Similar to the InputStream class, the abstract OutputStream class is a superclass of all classes representing an output stream of bytes. A few example...

David Miller
Java
 850 View(s)

Java I/O: File Copy Utility

The File Copy program accepts two command-line parameters and copies the contents of the file specified by the first parameter to the filename specifi...

David Miller
Java
 960 View(s)

Java I/O: The InputStream Methods

The read method we used in the previous post is in fact defined in the InputStream class. The FileInputStream class that extends from the InputStream ...

David Miller
Java
 1178 View(s)

Java I/O: Determining File Length

The simplest way to determine the length of a physical file is to open it in binary mode....

David Miller
Java
 1123 View(s)

Java I/O: The I/O Class Hierarchy

Java provides a rich set of classes for I/O. A high-level class diagram for the I/O class library is shown here:...

David Miller
Java
 1183 View(s)

Java I/O: Input/Output Streams

One of the important set of classes comprised in Java API is the java.io package. This is one of the core packages of the Java language and was a part...

David Miller
Java
 925 View(s)

Abstract Classes in Java

For an interface containing several methods, a developer can provide the implementation for some of the methods in a class that implements the interfa...

David Miller
Java
 903 View(s)

Arrays in Java: Determining Class of an Array (Part-8)

In previous posts, we have learnt how to find the length of the arrays and how to clone an array. Now here we learn how to find out the class of an ar...

David Miller
Java
 1045 View(s)

Arrays in Java: Cloning an Arrays (Part-7)

To make a copy of an array, we call the clone method on the array object. This is illustrated in this implementation:...

David Miller
Java
 1076 View(s)

Arrays in Java: Determine Length of Arrays (Part-6)

When we declare an array in Java, it is treated as an object of an internal class that defines useful attributes and methods....

David Miller
Java
 1252 View(s)

Arrays in Java: Non-Rectangular Arrays (Part-5)

So far we have seen the declaration and use of rectangular arrays. Java allows us to create non-rectangular arrays....

David Miller
Java
 5642 View(s)

Arrays in Java: Multidimensional Arrays (Part-4)

Multidimensional arrays, as the name suggests, contain more than one dimension. You can create two-dimensional, three-dimensional, and n-dimensional a...

David Miller
Java
 1144 View(s)

Arrays in Java: Array Initializations (Part-2)

In my previous post, we have already learned how to declare an array, allocate the space for its elements, and how to modify and access its elements. ...

David Miller
Java
 1509 View(s)