what is difference between throw and throws in exception?
Answer Posted / ritesh
Throw :- It is possible for your program to throw an
exception explicitly, using the throw statement.
Throws :- If a method is capable of causing an exception
that it does not handle, it must specify this behavior so
that callers of the method can guard themselves against that
exception.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Write a program to print 15 random numbers using foreach of java 8?
What is the difference between a switch statement and an if statement?
What is the difference between an object-oriented programming language and object-based programming language?
What is super in java?
Why runnable interface is used in java?
What are different types of arrays?
what is ststic with example
What is null data type?
Why does java have different data types for integers and floating-point values?
What a static class can contains?
how to create multithreaded program? : Java thread
what is the difference between Object Based Language and Object Oriented Language?
What is Java Package and which package is imported by default?
How to create an immutable class?
How do I know if java is installed?