JAVA- Specifying the exceptions

We use two keywords to specify the exception these are: throw throws 1.      throw: All methods use throw statement to throw an exception. The throw statement requires a single arguments …

JAVA- Handling the exceptions

To handle an exception condition the statement that may contain exceptional conditions is written in the ‘try’ block. This block is followed by one or more ‘catch’ blocks and optional …

Exception handling

An exception is an event which occurs during program execution and disrupts the normal flow of program instruction i.e. an exception is unwanted situation that disturbs the normal execution of …

JAVA- Life cycle of a thread

A thread can have five different states, during its life time a thread is always in any one of these states and can move from one state to another. Followings …

JAVA- Creating threads

New thread can be created in two different ways: 1.      Thread class 2.      Implementing ‘runnable’ 1.     Thread class: In this method we define a class that extends ‘thread’ class and …

JAVA Threads

A thread is a single sequential flow of control. It has a beginning, a body and an end and executes the command sequentially. Java enables us to use multiple flow …

JAVA- Constructors

A constructor is a member function of a class i.e. uses to create objects of the class. It has the same name as the class. A constructor has no return-type …

JAVA- Methods overloading

As like in function overloading in c++ we can overload the methods. In method overloading we can make the methods with the same name but with different parameters. When we …

JAVA- Classes and objects

All the functions are performed in the java with the help of classes and objects. Thus java is called a true object oriented programming language.  Class A class is encapsulates …

JAVA- Vectors

Vectors are created like the arrays but vector can hold the objects. And these objects can be of any type and size. In array the elements are must be homogeneous, …