what is difference between throw and throws in exception?

Answer Posted / clement

throws specifies that a method could throw an exception
while throw is used to throw a particular type of exception

throw IOException;

public void clem()throws exception

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is instance means in java?

566


What are inner classes or non static nested classes in java?

708


Define an applet in java?

634


In how many ways we can create threads in java?

636


Can we sort arraylist in java?

565






What are data structures in java?

535


What is the primary benefit of encapsulation?

562


What is the loop in java?

578


What is the super void?

463


Can we declare register variable as global?

517


How does a for loop work?

510


Is string is a class in java?

527


How do you know if a value is nan?

574


Does java allow overriding static methods ?

634


What is the meaning of 3 dots in java?

685