Latest Blogs – MindStick

Annotations in Java: Why we use Annotations?

One of the major goals of any IDE such as NetBeans or Eclipse is to enhance ease of development. The IDE generally provides the boilerplate code for many types of applications so that the developer can focus on the core functionality of the application.

 Java Java 
By Jonas Stuart posted   yesterday

Java I/O: Inpu and 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 of JDK 1.0.

 Java Java 
By zack mathews posted   2 days ago

Java I/O: The PushbackInputStream Class (Print Calculator Utility)

The PushbackInputStream class comes under the category of FilterInputStream classes.

By zack mathews posted   2 days ago

Autoboxing and Wrapper Classes in Java

J2SE 5.0 introduced a new feature called autoboxing and unboxing that automatically converts between the primitive data types and their wrapper classes. To understand this feature and appreciate its importance, we need to understand the previously us

 Java Java 
By Jonas Stuart posted   3 days ago

Java I/O: Live Data Application

We will now discuss the LiveData program mentioned earlier to illustrate the use of these classes. But before that lets see the case of NYSE and NASDAQ once again from previous post:

By zack mathews posted   4 days ago

Java I/O: The Byte-Oriented Stream Classes

As we can see from I/O class hierarchy diagram below, there are several more classes in this category. Although it is not possible to cover all these classes all together, we will look at how to use some of them in practical situations so that we are able to use the rest in our applications.

By zack mathews posted   4 days ago

Java I/O: Reading/Writing Objects -Serialization

The Java I/O library provides classes that allow us to read or write a user-defined object from or to a stream.

By zack mathews posted   4 days ago

Java I/O: Accessing the Host File System

Here we discuss another important class in the I/O package. The java.io.File class provides an abstract representation of a file or directory on the host file system.

 Java Java 
By zack mathews posted   4 days ago

Java I/O: File Concatenation

The File Concatenation program, as the name suggests, concatenates the contents of a given number of files. We specify the files on the command line as a variable argument list. The output of the program will be a new file that is a sequential combination of all the input files.

By zack mathews posted   4 days ago

Java I/O: The Line Count Program

The Line Count program counts the number of lines in the specified text file. Java provides a class called LineNumberReader for this purpose. The LineNumberReader class wraps the BufferedReader class, which in turn wraps the Reader class.

By zack mathews posted   4 days ago

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.

 Java Java 
By David Miller posted   5 days ago

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 .docx. Just the way we have several real (fully implemented) subclasses of input and output byte stream

 Java Java 
By David Miller posted   5 days ago

Java I/O: Determining File Length

The simplest way to determine the length of a physical file is to open it in binary mode.When we use the byte-oriented classes based on InputStream and OutputStream, the file will be opened in binary mode.

 Java Java 
By David Miller posted   5 days ago

Exception Handling in Java: Understanding throws with Example

Exception Handling in Java and Understanding throws with Example


Exception Handling in Java: Checked/Unchecked Exceptions and throws keyword

Sometimes, the checked exceptions are also called compile-time exceptions because our code would not compile if we do not handle a checked exception.


Exception Handling in Java: Printing a Stack Trace

In this post we are going to learn a very common practice developers usually follow when they are dealing with Exception handling.

By Ankit Singh posted   8 days ago

Exception Handling in Java: Asynchronous Exceptions and Important guidelines

The exceptions we have seen so far are synchronous in nature, in the sense that we know the point in the program where they occur and when they happen, and we process them immediately in the same thread. Contrary to this, an asynchronous exception may occur at any point in the execution of a program.

By Ankit Singh posted   8 days ago

Class Concepts in Java: Declaring Methods

Our Point class declared here contains only fields. Now, we will add a method to the Point class which will help us understand the method declaration and calling syntax.

 Java Java  Class 
By Ailsa Singh posted   8 days ago

Inheritance in Java: Why Inheritance?

One of the major benefits of object-oriented programming is code reuse. Programmers develop lot of code over time. If this code can be reused, they can save time and effort in developing and testing a new project. In structured programming, if the code is arranged in appropriate independent functions, it can be reused in future applications.

By Ailsa Singh posted   8 days ago

Exception Handling in Java: Basic Concepts

Looking at Murphy’s Law, “If anything simply cannot go wrong, it will anyway,” we know that we should always prepare ourself for the worst-case scenario.

By zack mathews posted   9 days ago

Exception Handling in Java: try-catch statements

We can easily catch and handle errors in our programs so that they do not terminate abnormally.

By zack mathews posted   9 days ago

Exception Handling in Java: Combining Exception Handlers

In my previous post, we have learnt how we can handle multiple exceptions in our code by providing multiple numbers of catch block specific to a particular exception. But Java SE 7 introduces a very handy feature by which we can combine several exceptions in a single catch block. Let’s learn this new feature.

By Ailsa Singh posted   9 days ago

Exception Handling in Java: The finally Statement

In the program example discussed in the previous post (multiple catch blocks section), we made a URL connection to read the home page contents from the user-specified URL. We closed this connection by calling the close method on the stream object.

By Ailsa Singh posted   9 days ago

Exception Handling in Java: Error Types

When a running Java application fails, it creates an exception object encapsulating the error condition and throws it back to the running code.

By Aliya Crox posted   9 days ago

Nested Classes in Java: Anonymous Classes

A local class without a name is called an anonymous class. If we need only a single instance of a local class, we will create an anonymous class. Typically, a local class has a name and thus a declaration. We instantiate this class using its name. This process is meaningful if we are going to make multiple objects of the class.

By Royce Roy posted   10 days ago

Don't want to miss updates? Please click the below button!

Follow MindStick