Java tutor oo ps introduction-version 1


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • - Top programming language - Survey Result for Java jobs Capital letters
  • 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).
  • Java tutor oo ps introduction-version 1

    1. 1. Object oriented programmingPresenting Object oriented Programming (Java) and aspects of management of project. Presented by Uday Sharma 1
    2. 2. Why this tutorial?To gain knowledge of Object Oriented ProgrammingWhy 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. 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. 4. After Student life CVObjectiv: bla bla –Study : bla bla–Programminglanguage : C, C++ InterviewProject work : Java 4
    5. 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
    6. 6. Why object oriented necessary ? 4 2 3 1 5 6 7 Parts/Objects/Member of ballpenBallpen 6
    7. 7. Why object oriented necessary ? Properties of Parts/Objects/Member Part 1 Part 2 Part 3 Part 4 Part 5 Part 64 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
    8. 8. Object oriented programming types• Java• C#• .Net• PHP• Python• C++• Lisp• Ruby on Rain• Objective- C• Matlab• Lisp 8
    9. 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, DiameterClass of class 2 Encapsulation 5 Member of Class 6, Class 7, Class 1, Class 2 9
    10. 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. 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. 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 reusableObject Object components Data • Create new DataMethod components from MethodMethod existing ones Method 12
    13. 13. Examples of objects 13
    14. 14. Classes: Objects with the same attribute and behaviorPerson 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. 15. Object Oriented Paradigm Encapsulation Data Abstration Single Inheritance OOP PolymorphysmParadigm Persistance Delegation Genericity Multiple Inheritance 15
    16. 16. Encapsulation Encapsulation It associates the code Data Abstration and the data it Single Inheritance manipulates into a OOP Polymorphysm single unit andParadigm Persistance keeps them safe from Delegation external interference Genericity and misuse Multiple Inheritance 16
    17. 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 ofParadigm 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. 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. 19. ClassClass is a set of attributes and class Account {operations that areperformed 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
    20. 20. Access ModifierPrivate :Protected:Public: Protected: Drinking beer Private: Drinking beer Public: Drinking beer 20
    21. 21. ExerciseCar --- Create class for carBird --- Create class for Bird 21
    22. 22. Solution for car Car BMW- hasNumberPlate - hasType- hasNoDoors - hasName - hasColor - hasEngineType - hasShape+ setDoors() + setDoors(hasshape,hasNoDoors)+setRoof() +setRoof(hasshape)+setGlass() +setGlass(hasShape)+setHeadlight() +setHeadlight(hasShape)+setWheel() +setWheel(hasShape) +setEngine() 22
    23. 23. Bird Example 23
    24. 24. Solution for bird Bird Parrot- hasHeight - hasType- hasWidth - hasName - hasbackColor,wingscolor.... - hasHeight+ setEye() - hasWidth+setLeg() - hasShape+setWing() + setWing(hasColor)+setThroat() +setLeg(hasShape)+setNape() +setWing(wingcolor)+setBack() +setBill(hasShape)+setBill() +setTail(hasShape)+setTail 24
    25. 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. 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
    27. 27. Inheritance- ExampleCircle Class can be a subclass (inherited from ) of a parent class -Shape 27
    28. 28. References• [<Project Management> <Youth partnership> <Page> http://youth- partnership/documents/Publications/T_kits/3/2_project.pdf >] 28