1 / 19

CO320 Introduction to Object-Oriented Programming

CO320 Introduction to Object-Oriented Programming. Michael Kölling. 3.0. Take control of your own learning. Lecture Classes Exercises Book Web page Discussion forum Study groups Practice, practice, practice!. Module web page (CO320). News Course material Slides Discussion forum.

Télécharger la présentation

CO320 Introduction to Object-Oriented Programming

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. CO320Introduction to Object-Oriented Programming • Michael Kölling 3.0

  2. Take control of your own learning • Lecture • Classes • Exercises • Book • Web page • Discussion forum • Study groups • Practice, practice, practice!

  3. Module web page (CO320) • News • Course material • Slides • Discussion forum

  4. Classes Classes in week 1

  5. Course Contents • Introduction to object-oriented programming… • …with a strong software engineering foundation… • …aimed at producing and maintaining large, high-quality software systems.

  6. Buzzwords responsibility-driven design • interface inheritance encapsulation iterators overriding coupling cohesion javadoc collection classes mutator methods polymorphic method calls

  7. Goals • Sound knowledge of programming principles • Sound knowledge of object-orientation • Able to critically assess the quality of a (small) software system • Able to implement a small software system in Java

  8. Book David J. Barnes & Michael KöllingObjects First with JavaA Practical Introduction using BlueJThird edition, Pearson Education, 2006ISBN 0-13-197629-X.

  9. Assessment

  10. Course overview • Objects and classes • Understanding class definitions • Object interaction • Grouping objects • More sophisticated behaviour - libraries • Well-behaved objects - testing, maintaining, debugging • Designing classes

  11. Demo

  12. Fundamental concepts • object • class • method • parameter • data type

  13. Objects and classes • objects • represent ‘things’ from the real world, or from some problem domain (example: “the red car down there in the car park”) • classes • represent all objects of a kind (example: “car”)

  14. Methods and parameters • Objects have operations which can be invoked (Java calls them methods). • Methods may have parameters to pass additional information needed to execute.

  15. Other observations • Many instances can be created from a single class. • An object has attributes: values stored in fields. • The class defines what fields an object has, but each object stores its own set of values (the state of the object).

  16. State

  17. Two circle objects

  18. Return values • Methods may return a result via a return value.

  19. Source code • Each class has source code (Java code) associated with it that defines its details (fields and methods).

More Related