Showing posts with label How To. Show all posts
Showing posts with label How To. Show all posts

Chained Exceptions in Java

  • 0
    Chained Exceptions were introduced in Java with JDK 1.4. In Chained exceptions, we can associate an exception with some other exception so that it can be inferred that occurrence of one exception is due to associated exception in reality.

Creating Your own Exceptions in Java

  • 0
     An exception is generally a run time error that leads to unwanted instant termination of the program. An exception must be handled, failing to do so leads to transfer of control of execution to Java's default exception handler. In this article, I would try to develop an exception which is generated if you use a special name "HERR".

Java Program to swap values of two numbers without temporary variable

  • 0
A typical value swapping progran involves use of a temporay storage to store the value of either of the two variables whose values is to be swapped. In here, I would try to make you understand the true logic of the oprogrm. This program is simply based on the fact that java assignment statement, for example,
a = 1 +3;
would add first 1 and 3, after the addition, the value is stored in the left hand value of the storage variable. Now, the program swapping vales is.

How to return Objects from Methods

  • 0
      Java enables us to return objects from the methods as well. Returning and passing objects need to consider the  parent child relationship among the classes. This relationship holds importance because, as a matter of fact, Object of parent class can hold the address of object of child class.

Fibonacci series program in Java

  • 0
Fibonacci series is one the most series es in the world. In a Fibonacci series, each term is the sum of last two terms. For the first two terms, 1st is taken as 0 and second is taken as 1. Fibonacci series has attracted a lot of attention and research. So. let us devote a JAVA program to print the Fibonacci series.

Java program to reverse a number

Java program to reverse a number is one of the simplest programming problems. The JAVA program that reverses a number is given.

How to use Objects as Parameter

     The first thing that anyone needs to know is the difference between argument and parameters. Arguments are the variables that are passed to the functions and parameters are the variables that receive the value of the arguments. Java rich Object Oriented Features allow us to use Objects as the parameter.

Factorial Program in Java

In mathematics, the factorial of the number is defined as

n! = n*(n-1)*(n-2)*(n-3)*(n-4)*...1

Method Overloading Demystified

  • 0
Method Overloading is one of the best features of the Object Oriented Language. With Method Overloading, Java implements Polymorphism.