❮ Previous Next ❯

Re-Throwing An Exception

Example

class Demo
{
static void viv( )
{
try
{
throw new NullpointerException(software);
catch(NullpointerException e)
{
system.out.println(viswass);
throw e; //rethrow the exception
}
}
}
{
public static void main( string args[ ])
{
try
{
viv( );
}
catch(NullpointerException e)
{
system.out.println(JavaRace);
}
}
}
}

Output

viswass
JavaRace


❮ Previous Next ❯


  Tutorials

Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Bhubaneswar-751013
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved