| Mobile | RSS

Java Tutorial : The Nested try catch Block

The nested try-catch block is used to handle exceptions in Java applications. You can enclose a try-catch block in an existing try-catch block. The enclosed try-catch block is called the inner try-catch block, and the enclosing block is called the outer trycatch block. If the inner try block does not contain the catch statement to [...]

[ More ] 23rd Apr, 2010 | No Comment | Posted in Java
Java Tutorial: Implementing Overriding Methods

Java Tutorial: Implementing Overriding Methods

When you extend the functionality of a class, the subclass inherits the data members and methods from the superclass. For example, if the superclass has a show() method, which displays the value of the superclass, the subclass inherits the show() method from the superclass. When you call this method from an object of the subclass, [...]

[ More ] 11th Sep, 2009 | No Comment | Posted in Java
Java Tutorial : Multilevel Inheritance

Java Tutorial : Multilevel Inheritance

In multilevel inheritance, a subclass inherits the properties of another subclass. For example, Class A is a superclass for the Class B; and Class B is a superclass for the subclass, Class C. You can include any number of levels in multilevel inheritance. The following syntax shows how to implement multilevel inheritance: class A { [...]

[ More ] 7th Sep, 2009 | 2 Comments | Posted in Java
Inheritance Example Output

Java Tutorial : Inheritance in Java – Part 2, Example

In the last article we saw the inheritance in java. The following syntax shows how to implement single level inheritance: class A { //body of Class A } class B extends A { //body of Class B } class C extends A { //body of Class C } In the preceding syntax, the extends keyword [...]

[ More ] 7th Sep, 2009 | No Comment | Posted in Java