Summer Training Etp: Object Oriented Programming Using Java
Summer Training Etp: Object Oriented Programming Using Java
Submitted by :
• Importance of Java
• Classes and Objects
• Inheritance and Polymorphism
• String
• Exception Handling
• JDBC
• Application Development
• Certificate display
2
Importance of Java
Write software on one platform and run it on virtually any other
platform.
Create programs that can run within a web browser and access
available web services.
Develop server-side applications for online forums, stores, polls, HTML
forms processing, and more.
Combine applications or services using the Java language to create
highly customized applications or services.
Write powerful and efficient applications for mobile phones, remote
processors, microcontrollers.
3
Classes and Objects
Classes:-
A Class is like an object constructor, or a "blueprint" for creating objects.
Syntax:-
public class classname
{
//attribute of class
}
Objects:-
An object is created from a class.
Syntax:-
public class classname
{
//attribute of class
}
public static void main(String[] args)
{
classname obj=New classname();
}
5
Inheritance and Polymorphism
Inheritance:-
In Java, it is possible to inherit attributes and methods from one class to
another. We group the "inheritance concept" into two categories:
Subclass (child) - the class that inherits from another class.
Superclass (parent) - the class being inherited from.
Class xy
{
//attribute of parent
}
Class ab extand xy
{
//attribute of child which hold porperty of parent;
}
6
Polymorphism:-
Polymorphism means "many forms", and it occurs when we have many
classes that are related to each other by inheritance.
Syntax:-
Public class xyz
{
//attributes
}
Public class ab extend xyz
{
//attributes
}
Major difference between inheritance and Polymorphism in inheritance lets
us inherit attributes and methods from another class. Polymorphism uses
those methods to perform different tasks. 7
String
String :-
A String variable contains a collection of characters surrounded by double
quotes.
Syntax:-
String greeting = "Hello";
String have different method like:
Length()
toUpperCase()
toLowerCase()
indexOf()
8
Exception Handling
Exception:-
Exception indicates conditions that a reasonable application might
try to catch.
Error:-
An Error indicates serious problem that a reasonable application
should not try to catch.
Exception handling:-
Whenever inside a method, if an exception has occurred, the method
creates an Object known as Exception Object and hands it off to the
run-time system(JVM)
9
10
JDBC
11
Abstract And Interface
12
Certificate
13