In this presentation we introduce topic of core java that is required to learn if you want to be good java programmer. i provide all concept in detail.
4. What is java?
Java is an OOPs based Internet Programming
language.
Feature of java.
Platform Independent
Secured
Simple
Robust
Multithreaded
Distributed
5. OOPs concept
Class : it is blue print of own object. We create
class in java using class keyword.
class Student
{
String name = “shivendra srivastwa “;
}
Object : objects are runtime entities that is used
to access property of class. We create object using
“new” keyword.
Eg. Student st = new Student();
6. Encapsulation
It is a way to wrap data member and methods in
single unit. Encapsulation is achieved at the time
of object creation.
Data Member
Methods
8. Inheritance
Extending the Property of Parent class to child class known as
Inheritance.
“extends” keyword is used for inheritance.
class Parent
{
//member of Parent
}
class child extends Parent
{
// member of parent
// member of child
}
Java support only single level , Multilevel and Hierchical
Inheritance.
9. Polymorphism
One thing in many form known as
polymorphism.
Compile Time Polymorphism(over loading).
Run time polymorphism(overriding).
10. Exception handling
Exceptions are unexpected condition that comes at
the time of program execution.
Exception handling is a mechanism by which we can
handle exception. Java provide five key terms to
handle exception.
1.try{} => is a block in which we write such code that
have may occur exception.
2. catch(Exception e)=> catch the exception thrown by
try and take appropriate action.
3.finally{}=> must be executable block.
4.throw=> use to throw explicit exception.
5.throws=>use as signboard to notify developer such
exception occur method.