category

home / developersection / category

Exception Handling in Java: Asynchronous Exceptions and Important guidelines
java 21-May-2016
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.

Class Concepts in Java: Declaring Methods
java 21-May-2016
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.

Inheritance in Java: Why Inheritance?
java 21-May-2016
Inheritance in Java: Why Inheritance?

IntroductionOne of the major benefits of object-oriented programming is code reuse. Programmers develop lot of code over time. If this code can be reu

Exception Handling in Java: Basic Concepts
java 20-May-2016
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.

Exception Handling in Java: try-catch statements
java 20-May-2016
Exception Handling in Java: try-catch statements

We can easily catch and handle errors in our programs so that they do not terminate abnormally. When a program terminates abnormally, typically it dum

Exception Handling in Java: Combining Exception Handlers
java 20-May-2016
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.

Exception Handling in Java: The finally Statement
java 20-May-2016
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.

Exception Handling in Java: Error Types
java 19-May-2016
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. The ex

Nested Classes in Java: Anonymous Classes
java 19-May-2016
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.

Nested Classes in Java: Local Classes
java 19-May-2016
Nested Classes in Java: Local Classes

A non-static class defined within a class is called a member class of the enclosing class. A member class is commonly used as a helper class to the enclosing class.

Nested Classes in Java: Demonstrating Use of Inner Classes
java 19-May-2016
Nested Classes in Java: Demonstrating Use of Inner Classes

uppose we are required to create an application that generates a random list of odd numbers. The list itself should consist of a random number of entr

Nested Classes in Java: Why use Nested Classes?
java 19-May-2016
Nested Classes in Java: Why use Nested Classes?

Introduction As the name suggests, we can embed a class declaration within another class. This gives us the power to hide our classes within an outer