ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
JAVA BASICS
By
Dr. Chitradevi D
Introduction to Java
Syntax:
class MyClass {
// class methods
constructor() { ... }
method1() { ... }
method2() { ... }
method3() { ... }
...
}
¡ñ Object/Instances
Class Diagram
Method Binding
Overriding
Exception Hierarchy
Keywords of exception:
Difference between throw and throws
No. throw throws
1) In Java, the throw keyword is used to
explicitly throw an exception.
In Java, the throws keyword is used to
signal the occurrence of an exception.
2) Throwing alone will not propagate
checked exceptions.
Throws can be used to propagate checked
exceptions.
3) An instance follows the throw. Throws is immediately followed by class.
4) Throws is immediately followed by
class.
The keyword throws is used in the method
signature.
5) You can't throw several exceptions at
the same time.
Multiple exceptions can be declared. e.g.
public void method()throws
IOException,SQLException.
Features of OOPS

More Related Content

Object Oriented Programming Basic Concepts