1 / 11

Unit 19 & Unit 41

Unit 19 & Unit 41. Object Orientated Programming Programming in Java. S W Hoare. s.hoare@bcmuk.org.uk. Classroom Rules. Arrive Promptly Please (by 10am or 2pm) No Food & Drink in IT Lab Breaks are at the Tutor’s Discretion Mobile phones should NOT be seen or heard Do not mark the desks

ilya
Télécharger la présentation

Unit 19 & Unit 41

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unit 19 & Unit 41 Object Orientated Programming Programming in Java

  2. S W Hoare s.hoare@bcmuk.org.uk

  3. Classroom Rules • Arrive Promptly Please (by 10am or 2pm) • No Food & Drink in IT Lab • Breaks are at the Tutor’s Discretion • Mobile phones should NOT be seen or heard • Do not mark the desks • Mains lead for Laptops must be checked by a member of staff to ensure they are not worn • Leave the room as you found it

  4. Object Orientated Programming • One of a number of Programming Paradigms • Models the problem in terms of objects • The program then consists of the interactions between these objects. • The programmer writes the definition of the objects, not the objects themselves.

  5. Java • Created by Sun • Owned by Oracle • Inherits C syntax • One of a number of Object Orientated Languages • Free to download • JRE – Java Runtime Environment • JDK – Java Development Kit

  6. BlueJ • IDE – Integrated Development Environment • Written in Java • Designed for teaching Java • Free to download • Course based on Objects First with Java

  7. What is an Object • Computer code representing a discrete item from the problem domain. • http://docs.oracle.com/javase/tutorial/java/concepts/object.html • All have State & Behaviour • An object’s state is kept in it’s fields • An object’s behaviour is defined by it’s methods

  8. Bicycle Example

  9. Bicycle • State • current gear • current pedal cadence • current speed • Behaviour • changing gear • changing pedal cadence • applying brakes

  10. Class • Instead of creating each individual object We create a class • The difference between Class and object is the difference between Car and my car at home. • Two cars may be identical in all respects except for their VIN number and number plate. • Two objects of the same class may have exactly the same state, but will still be distinguishable.

  11. Instance • An object may also be known as an instance of a class • Creating an object may be called instantiate

More Related