0% found this document useful (0 votes)
50 views

Lecture 0 - Course Introduction

The document introduces a university course on object-oriented programming in Java. It provides information on course details, staff, description, learning outcomes, delivery mode, schedule, assessment, expectations, requirements and content.

Uploaded by

Mtoi Tv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Lecture 0 - Course Introduction

The document introduces a university course on object-oriented programming in Java. It provides information on course details, staff, description, learning outcomes, delivery mode, schedule, assessment, expectations, requirements and content.

Uploaded by

Mtoi Tv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

University of Dar es Salaam

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

Requirements & Preparatory Tasks


University of Dar es Salaam
Preparatory Tasks
• Familiarise yourself with the LMS and enroll yourself on CS 234
• https://lms.udsm.ac.tz/
• Fill in the registration form
• Set up Java on your computer
• Setup a GitHub account if you do not have one already
• Accept the assignment (by clicking the link in the LMS)
• Do assignments 0 and 1
University of Dar es Salaam
1. Get access to the LMS and enrol into CS234
• https://lms.udsm.ac.tz
• Enrollment key: cs234_2024
University of Dar es Salaam
2. Fill Registration Form
https://bit.ly/udsm_cs234_2024
University of Dar es Salaam
3. Setup Java on your computer
• Java Development Kit (Java 8.0 or later)
• An IDE such as IntelliJ IDEA, Eclipse, Netbeans, or a suitable text
editor such as Visual Studio Code
University of Dar es Salaam
Setup a GitHub account

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

Object Oriented Programming


University of Dar es Salaam
What is Programming?
University of Dar es Salaam
What is Programming?
Programming
Language

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

State State State


University of Dar es Salaam
Procedural Languages
• Decomposes problems into procedures/subroutines/functions
• Subroutine: named block of code that should perform one task and can be
called when needed
• Emphasis on doing things
• functions
University of Dar es Salaam
Pascal C
University of Dar es Salaam
Complex Problem = Complex Program
State Operations
State
Operations State

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.

• OOP allows us to decompose a problem into several entities called


objects and then build data and functions around these entities.
University of Dar es Salaam
Object Oriented Programming
• What kinds of things become objects in object-oriented programs?
• Human entities: Employees, customers, salespeople, workers, manager
• Graphics program: Point, line, square, circle…
• Mathematics: Complex numbers, matrices…
• Computer user environment: Windows, menus, buttons…
• Data-storage constructs: Customized arrays, stacks, linked lists…
University of Dar es Salaam
Object Oriented Programming
• Thinking in terms of objects rather than
functions simplifies the program design
process
• To create software models of real-world
objects, both data and functions that
operate on that data are combined into a
Procedural Object-Oriented
single entity - Object
• Data and its functions are said to be
encapsulated
• Data is hidden and can only be accessed via
methods.
University of Dar es Salaam
The Object Model
• A software system is a set of cooperating objects
• Objects have state and processing ability
• Objects exchange messages
• Objects have
• State
• Identity
• Lifecycle
• Location
• Behaviour
University of Dar es Salaam
Pure Object-Oriented Languages
• Everything is an object.
• A program is a set of objects telling each other what to do by sending
messages.
• Each object has its own memory (made up of other objects).
• Every object has a type.
• All objects of a specific type can receive the same messages.
University of Dar es Salaam
OOP vs Procedural Programming
OOP Procedural Programming
• Provides tools to represent • Still requires you to think in
elements in the problem space terms of the structure of the
computer instead of the
• The program can adapt itself problem
by adding new types of objects • Programmer must establish
• Allows the programmer to the association between the
describe the problem in terms machine and problem models
of the problem instead of the • The effort for mapping is
computer where the solution difficult and expensive to
will run maintain
University of Dar es Salaam
Benefits of OOP
• Readability
• Understandability
• Low probability of errors
• Maintenance
• Reusability
• Teamwork
University of Dar es Salaam
OOP
Object
State

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

You might also like