Lecture 0 - Course Introduction
Lecture 0 - Course Introduction
CS 234: Object-Oriented
Programming in Java
Course Introduction
Aron Kondoro
University of Dar es Salaam
Course Information
• Course Code: CS 234
• Course Name: Object Oriented Programming in Java
• Prerequisite: CS 175 Programming in Java
University of Dar es Salaam
Course Staff
• Lecturer
• Aron Kondoro ([email protected])
• Practical Assistants
• Mr. Marco Masembo ([email protected])
University of Dar es Salaam
Course Description
• Introduces object-oriented programming using the Java
programming language
• The course focuses on the understanding and practical mastery of
object-oriented concepts such as classes, objects, inheritance, data
encapsulation, data abstraction, polymorphism and dynamic binding
University of Dar es Salaam
Learning Outcomes
• Understand the key features of the Java programming language
• Apply object-oriented programming techniques using Java
• Explain the principles behind good object-oriented design
• Use and manipulate different Built-In Java Classes and APIs
• Write Java code to produce simple Java applications
University of Dar es Salaam
Delivery Mode
• Lectures
• PowerPoint slides posted weekly in the LMS
• Live Demos
• In class
• Supplemental resources
• i.e. notes, video clips etc
• Lab exercises
• Designed to help students practice and master the material
University of Dar es Salaam
Course Schedule
• Lecture
• Monday, 1800 – 1955, D01 Luhanga Hall
• Lab Practicals
• Wednesday, 0700 – 0855, B106
• Thursday, 1800 – 1955, B106
University of Dar es Salaam
Assessment
• Test (20)
• Lab Assignments (20)
• You will be asked to write code that produces specific outputs and/or behaves
in very specific ways.
• Examination (60)
• The final examination will be a 3 hours on-site exam and will be administered
during the examination period at the end of the term.
University of Dar es Salaam
Course Expectations
• Students are required to attend lectures and complete labs and any
assignments.
• No makeup lab/assignment/exam will be accepted unless there is an
emergency, in which case documented evidence may be required.
• All work must be submitted by the due date/time.
• No type of academic dishonesty will be tolerated.
• If you are caught cheating (on assignments or exams), the punishment will be
the most severe penalty allowed by the university policy.
University of Dar es Salaam
How do I succeed?
1. Attend lectures
2. Be active
• Log into the LMS at least once weekly (and preferably more)
3. Do labs on time
4. Access supplementary resources
• Notes, textbook, links etc
University of Dar es Salaam
https://github.com
University of Dar es Salaam
GitHub Classrooms
University of Dar es Salaam
Assignments/Labs
• Each assignment will be distributed in the form of repositories
• If you experience problems while uploading assignments, email me
your work for grading IMMEDIATELY AND BEFORE THE DUE
DATE/TIME, along with a screenshot of the upload error.
• Unless otherwise stated, no assignments will be accepted late.
University of Dar es Salaam
Content of the Course
• Introduction to OOP • Abstraction
• Java Basics • Object-Oriented Design
• Classes and Objects Principles
• Inheritance • Collections
• Polymorphism • Exceptions
• Encapsulation • Generics
• GUI components in Java
University of Dar es Salaam
Introduction to OOP
• Introduction to programming paradigms
• What is OOP?
• A brief history of OOP
• Advantages of using OOP
University of Dar es Salaam
Java Basics
• Overview of Java programming language
• Installation and setup
• Creating your first Java program
• Variables, data types, and operators in Java
• Control flow statements (if-else, loops, switch)
• Methods and functions in Java
University of Dar es Salaam
Classes and Objects
• What are classes and objects?
• Defining and creating classes in Java
• Creating and using objects in Java
• Constructors in Java
• Object initialisation
University of Dar es Salaam
OOP Concepts
University of Dar es Salaam
Collections
University of Dar es Salaam
Exceptions
University of Dar es Salaam
GUI
University of Dar es Salaam
Java Frameworks
University of Dar es Salaam
Recommended Readings
• Books
• Horstman, Cay. Big Java Early Objects 6th Edition. New York: John Wiley &
Sons, Inc. (4rd and 5th Editions are also acceptable) [This is a great
introduction to the Java programming language.]
• Schildt, Herbert. Java 7: A Beginner's Guide. McGraw-Hill, Inc., 2010.
• Bates, Bert, and Kathy Sierra. Head First Java Second Edition. (2021).
University of Dar es Salaam
Online Resources
• https://www.youtube.com/playlist?list=PL9DF6E4B45C36D411
• https://www.w3schools.com/java/java_oop.asp
• https://www.w3resource.com/java-exercises/
• https://java-programming.mooc.fi/
University of Dar es Salaam
Abstraction/
Modelling Implementation
Programmer
Computer Program
Real World
University of Dar es Salaam
Programming Languages
University of Dar es Salaam
What is a Program?
State
Operations
Operations
State
.
.
.
Operations
Operations
University of Dar es Salaam
Procedural Programming
Main Program
Function/Procedure
Operations Operations
Operations
Function/Procedure
Operations
Operations
Operations
Operations Operations
State
Operations
Operations Operations
Operations State
University of Dar es Salaam
Problems
• Data is undervalued
• Procedural programs do not model the real world very well
• Global data can be corrupted
• Refactoring is difficult
University of Dar es Salaam
Example: University Administration System
University of Dar es Salaam
Extend the program
University of Dar es Salaam
Object Oriented Programming
• Computer programs may contain representations of the things
(objects) that constitute the solutions to real-world problems
• Real-world objects have two parts
• Properties (characteristics that can change)
• Behaviour (things they can do)
• To solve a programming problem in OOP the programmer no longer
asks how the problem will be divided into functions but how it will be
divided into objects
University of Dar es Salaam
Object Oriented Programming Paradigm
• OOP treats data as a critical element in program development and
does not allow it to flow freely around the system.
• OOP ties data more closely to the functions that operate on it and
protects it from accidental modification from outside functions.
Operations
Object
State
Object
Operations State
Operations
University of Dar es Salaam
What is an Object?
• A unit that combines state and operations
• A set of operations with a shared state
• Anything with state and associated procedures
University of Dar es Salaam
OOP Concepts