2. Why this tutorial?
To gain knowledge of Object Oriented Programming
Why this tutorial for java why not for C++?
• Aim to do practice on Object Oriented programming and
understanding of basic needs to be a programmer
• Knowing C++ or Java will not make us a programmer but
understanding of project, project requirement , project
management are really important
• Company demand force you to work on different technology
• Right platform to learn something new what we do not know
2
3. Why this tutorial?
Why java ?
• Open source package
• Wastly useful in Web technology Java developers and general
software developers in permanent
• Java Embedded technology roles get an average salary of
• Client / Server application between €42,000 and €60,000 per
• Graphical user interface year in 2012. This compares to an
average salary of €40,000 to
• Design patterns €55,000 in 2011.
• Test-driven development APIs However, in London, Java
developers managed to get an
average salary of between €66,000
and €107,000, while in Sydney,
they could get salaries of between
€73,000 and €105,000.
3
4. After Student life
CV
Objectiv: bla bla –
Study : bla bla–
Programming
language : C, C++
Interview
Project work :
Java
4
5. What is object – oriented?
Object Properties
Barking
State(Varia Entity
ble) (Methods)
Name Barking
Biting
Color Play
Breed Slobber
Hungry Biting
Germany
Asian country Money
No rains
money 5
7. Why object oriented necessary ?
Properties of Parts/Objects/Member
Part 1 Part 2 Part 3 Part 4 Part 5 Part 6
4 1 6 Name Name Name Name Name Name
Color Color Color Upper-
Color
Ink-
Color
3
Size Size Size Size Size Size
Grip Grip Grip Grip Grip Grip
7 Notch Notch Notch Notch
2 Size
Shape Shape Round Shape Shape
Shape
7
9. Real time example of OOPs
Concept
Sun Rise Ltd
Sun Rise Ltd
Class Ballpen
Sun Rise Ltd.
Ballpen
S.Class S.Class S.Clas
3 1 3 s2
2 1 S.Clas S.Clas
s5 s6
Sub Class of Sub Class of Sub Class of
class Ballpen class Ballpen class Ballpen Class 7.
Inheritance
7
6 Sub class of class 1 Name, shape,color
and grip, Diameter
Class of class 2 Encapsulation
5
Member of Class 6, Class 7, Class 1, Class 2 9
10. Interview question
• What is an Object in OOPS?
• What is an Attribute in OOPs?
• What is a Entity in OOPS?
• What is an Identity in OOPS?
• What is Encapsulation in OOPS?
• What is Inheritance in OOPS?
• What is Polymorphism in OOPS?
• What is Compile Time Polymorphism in OOPS?
• What is Run Time Polymorphism in OOPS?
• What is Access Modifier in OOPS?
10
11. Characteristic of project?
• Project have a purpose
• Project are realistic
• Project have duration
• Project are complex
• Project are collective
• Project are unique
• Project are adventure
• Project can be assessed
• Project are made up of stages
11
12. OOP: model, map, reusability
, extention
Object • Model the real world
Data problem to user’s
Method perceive
Method • Use similar metaphor
in computational env.
Construct reusable
Object Object components
Data • Create new
Data
Method components from
Method
Method existing ones
Method
12
14. Classes: Objects with the same
attribute and behavior
Person Object
Abstract Person Class
into Attributes: Name, Age, Sex
Method :Speak(), Listen(), Walk()
Vehicle Object
Vehicle Class
Abstract Attributes: Name, Model, Car
into Method :Start(), Stop(), Accelerator()
Polygon Object
Polygon Class
Abstract Attributes: Vertices, border, color, Fillcolor
into Method :Draw(), Erase(), Move()
14
15. Object Oriented Paradigm
Encapsulation
Data Abstration
Single Inheritance
OOP Polymorphysm
Paradigm Persistance
Delegation
Genericity
Multiple Inheritance
15
16. Encapsulation
Encapsulation
It associates the code
Data Abstration
and the data it
Single Inheritance
manipulates into a
OOP Polymorphysm
single unit and
Paradigm Persistance
keeps them safe from
Delegation
external interference
Genericity
and misuse
Multiple Inheritance
16
17. Data Abstraction
Encapsulation • The technique of
Data Abstration
creating new data types
that are well suited to an
Single Inheritance
application
OOP Polymorphysm • It allows the creation of
Paradigm Persistance user defined data types,
Delegation having the properties of
built data types and a set
Genericity
of permitted operators
Multiple Inheritance • In Java, partial support
• In C++, fully supported
(e.g., operator overloading)
17
18. Abstract Data Type
• A structure that contains both data and the actions to be
performed on that data
• Class is an implementation of an Abstract Data Type
18
19. Class
Class is a set of attributes and
class Account {
operations that are
performed on the attributes.
//Attributes of account.
private String accountName;
private double accountBalance;
Account
+accountName //Entity of account.
+accountBalance public withdraw();
+withdraw(); public deposit();
+deposit(); public determineBalance();
+determineBal(); } / / Class Account
19
25. Inheritance
• New data types (classes) can be defined as extensions to
previously defined types
• Parent Class (Super Class) – Child Class (Sub Class)
• Subclass inherits properties from the parent class
Parent
Inherited
Capability
Child
25
26. Inheritance-Example
• Example
• Define Person to be a class
• A Person has attributes, such as age, height, gender
• Assign values to attributes when describing object
• Define student to be a subclass of Person
• A student has all attributes of Person, plus attributes of
his/her own ( student no, course_enrolled)
• A student has all attributes of Person, plus attributes of
his/her own (student no, course_enrolled)
• Define lecturer to be a subclass of Person
• Lecturer has all attributes of Person, plus attributes of
His/her own ( staff_id, subjectID1, subjectID2)
26
http://www.eweek.com/c/a/Application-Development/Java-C-C-Top-18-Programming-Languages-for-2011-480790/ - Top programming languagehttp://www.siliconrepublic.com/careers/item/26777-java-net-and-c-develop - Survey Result for Java jobshttp://pages.cs.wisc.edu/~hasti/cs368/JavaTutorial/NOTES/Java_vs.htmlChange: Capital letters
http://wiki.tcl.tk/13398http://www.dotnetperls.com/oopObjectsObjects are the basic run-time entities in an object-oriented system. Programming problem is analyzed in terms of objects and nature of communication between them. When a program is executed, objects interact with each other by sending messages. Different objects can also interact with each other without knowing the details of their data or code.ClassesA class is a collection of objects of similar type. Once a class is defined, any number of objects can be created which belong to that class.Data Abstraction and EncapsulationAbstraction refers to the act of representing essential features without including the background details or explanations. Classes use the concept of abstraction and are defined as a list of abstract attributes. Storing data and functions in a single unit (class) is encapsulation. Data cannot be accessible to the outside world and only those functions which are stored in the class can access it.InheritanceInheritance is the process by which objects can acquire the properties of objects of other class. In OOP, inheritance provides reusability, like, adding additional features to an existing class without modifying it. This is achieved by deriving a new class from the existing one. The new class will have combined features of both the classes.PolymorphismPolymorphism means the ability to take more than one form. An operation may exhibit different behaviors in different instances. The behavior depends on the data types used in the operation. Polymorphism is extensively used in implementing Inheritance.
Do not use full stops if information define by bullet (Mainly if information are 1 line). have a purpose: projects have clearly-defined aims and set out to produceclearly-defined results. Their purpose is to solve a “problem”, and this involves analysingneeds beforehand. Suggesting one or more solutions, it aims at lasting social change.Projects are realistic: their aims must be achievable, and this means takingaccount both of requirements and of the financial and human resourcesavailable.Projects are limited in time and space: they have a beginning and an end,and are implemented in a specific place and context.Projects are complex: projects call on various planning and implementation skills, andinvolve various partners and players.Projects are collective: projects are the product of collective endeavour. They are run byteams, involve various partners and cater for the needs of others.Projects are unique: all projects stem from new ideas. They provide a specific responseto a need (problem) in a specific context. They are innovative.Projects are an adventure: every project is different and ground-breaking; they alwaysinvolve some uncertainty and risk.Projects can be assessed: projects are planned and broken down into measurable aims,which must be open to evaluation.Projects are made up of stages: projects have distinct, identifiable stages (see Chapter 3:The project: step by step).