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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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, …