AbdalRaheem Al Smadi
Office: E1-3040
Phone: 03-713-5502
Email: afalsmadi@uaeu.ac.ae
Office Hours: Announced on Blackboard
Course Detail
Build reliable Java software using encapsulation, inheritance, and design best-practices reinforced by labs.
Office: E1-3040
Phone: 03-713-5502
Email: afalsmadi@uaeu.ac.ae
Office Hours: Announced on Blackboard
Object-oriented design, encapsulation and information hiding, behavior separation, inheritance, polymorphism, class hierarchies, collection classes and iteration, primitive data structures, and IDE based programming practice with an integrated lab component.
| Week | Topics | CLOs | Activities / Assessment |
|---|---|---|---|
| 1 | Intro to Java, identifiers, literals, operators, variables, data types | 1 | Lectures, smartboard, hands-on |
| 2 | I/O events, selection control structures | 1 | Lectures + Assignment 1 (Java syntax) |
| 3 | Repetition, strings, user defined methods | 1 | Lectures + Assignment 2 |
| 4 | Objects, reference variables, user defined classes, constructors | 1,2 | Lectures + Quiz 1 |
| 5 | Accessors/mutators, toString, private members | 1,2 | Lecture/discussion |
| 6 | Copy semantics, UML, this/static keywords | 1,2 | Assignment 3 |
| 7 | Object composition & interaction | 3 | Quiz 2 |
| 8 | Composition case studies | 3 | Assignment 4 |
| 9 | Review + Midterm Exam | -- | Midterm |
| 10 | One-dimensional arrays, passing arrays to methods | 5 | Lectures, hands-on |
| 11 | Arrays of objects | 5 | Assignment 5 |
| 12 | Inheritance, access rights, overriding Object class | 4 | Quiz 3 |
| 13 | Superclass constructors, constructor chaining, intro to polymorphism | 4 | Assignment 6 |
| 14 | Polymorphism, dynamic binding, casting, overriding rules | 4 | Quiz 4 |
| 15 | Final Review | -- | Review session |
| 16 | Final Exam | -- | Final Exam |
Set up the toolchain, reinforce literals and identifiers, and print diagnostic output.
Practical example
Study planner prints the Java version and suggests a workload plan.
public class StudyPlanner {
public static void main(String[] args) {
int credits = 3;
double studyHours = credits * 2.5;
System.out.println("Java version: " + System.getProperty("java.version"));
System.out.println("Plan " + studyHours + " study hours this week.");
}
}
Capture user input and apply branching rules to provide quick recommendations.
Practical example
Score adviser routes students toward extra practice when needed.
import java.util.Scanner;
public class ScoreAdvisor {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Quiz score: ");
int score = scanner.nextInt();
if (score >= 70) {
System.out.println("Advance to project work.");
} else {
System.out.println("Review selection statements.");
}
scanner.close();
}
}
Use loops and helper methods to automate iterative tasks and practice tracing.
Practical example
Countdown routine demonstrates nested control flow and method reuse.
public class CountdownDemo {
public static void main(String[] args) {
showCountdown(5);
}
static void showCountdown(int start) {
for (int value = start; value >= 1; value--) {
System.out.println("T-" + value);
}
System.out.println("Launch!");
}
}
Model classes with constructors that ensure every instance has valid state.
Practical example
Course blueprint tracks credit hours and produces a readable summary.
public class CourseBlueprint {
private final String code;
private final int credits;
public CourseBlueprint(String code, int credits) {
this.code = code;
this.credits = credits;
}
public String describe() {
return code + " carries " + credits + " credits.";
}
public static void main(String[] args) {
CourseBlueprint oop = new CourseBlueprint("CSBP219", 3);
System.out.println(oop.describe());
}
}
Encapsulate data with getters/setters while overriding methods such as toString().
Practical example
Lab seat object toggles reservation state and reports its status.
public class LabSeat {
private String student;
private boolean reserved;
public LabSeat(String student) {
this.student = student;
this.reserved = true;
}
public void release() {
reserved = false;
}
@Override
public String toString() {
return student + " reserved: " + reserved;
}
public static void main(String[] args) {
LabSeat seat = new LabSeat("Aisha");
seat.release();
System.out.println(seat);
}
}
Experiment with copy constructors and static members inspired by UML diagrams.
Practical example
Project brief is duplicated safely so edits never leak to the original.
public class ProjectBrief {
private final String title;
private final String advisor;
public ProjectBrief(String title, String advisor) {
this.title = title;
this.advisor = advisor;
}
public ProjectBrief(ProjectBrief other) {
this(other.title, other.advisor);
}
public String summary() {
return title + " mentored by " + advisor;
}
public static void main(String[] args) {
ProjectBrief original = new ProjectBrief("Smart Campus", "Dr. Noor");
ProjectBrief copy = new ProjectBrief(original);
System.out.println(copy.summary());
}
}
Compose several light-weight objects (rooms, meetings) to describe complete sessions.
Practical example
Nested classes keep meeting information organized around a shared schedule.
public class CourseMeetingDemo {
public static void main(String[] args) {
Room room = new Room("E1-3040");
CourseMeeting meeting = new CourseMeeting("CSBP219", room);
System.out.println(meeting.detail());
}
static class Room {
private final String number;
Room(String number) {
this.number = number;
}
String label() {
return number;
}
}
static class CourseMeeting {
private final String course;
private final Room room;
CourseMeeting(String course, Room room) {
this.course = course;
this.room = room;
}
String detail() {
return course + " meets in " + room.label();
}
}
}
Focus on controller objects that collaborate with helper classes to trigger actions.
Practical example
Enrollment monitor delegates notifications to its notifier collaborator.
public class EnrollmentMonitor {
private final Notifier notifier = new Notifier();
public void record(int seatsLeft) {
if (seatsLeft <= 0) {
notifier.alert("Section closed");
}
}
public static void main(String[] args) {
EnrollmentMonitor monitor = new EnrollmentMonitor();
monitor.record(0);
}
static class Notifier {
void alert(String message) {
System.out.println("Notice: " + message);
}
}
}
Review critical algorithms by summarizing quiz data before the exam.
Practical example
Average calculator reiterates loops, arrays, and formatted output.
public class ReviewSummary {
public static void main(String[] args) {
int[] quizScores = {65, 74, 81, 90};
int total = 0;
for (int score : quizScores) {
total += score;
}
double average = total / (double) quizScores.length;
System.out.println("Average quiz: " + average);
}
}
Pass arrays into helper methods to compute aggregates and search results.
Practical example
Utility returns the maximum lab score using enhanced for loops.
public class ArrayWorkshop {
public static void main(String[] args) {
int[] labs = {5, 7, 9};
System.out.println("Highest: " + max(labs));
}
static int max(int[] values) {
int best = values[0];
for (int value : values) {
if (value > best) {
best = value;
}
}
return best;
}
}
Allocate arrays that store richer domain objects and iterate over them.
Practical example
Inventory demo loops through device objects to print labels.
public class InventoryDemo {
public static void main(String[] args) {
Device[] devices = { new Device("Sensor"), new Device("Camera") };
for (Device device : devices) {
System.out.println(device.label());
}
}
static class Device {
private final String name;
Device(String name) {
this.name = name;
}
String label() {
return name;
}
}
}
Extend foundational classes and customize behavior in derived lab-focused courses.
Practical example
LabCourse inherits from CourseShell and adds venue details.
public class LabCourse extends CourseShell {
private final String labRoom;
public LabCourse(String code, String labRoom) {
super(code);
this.labRoom = labRoom;
}
@Override
public String outline() {
return super.outline() + " lab in " + labRoom;
}
public static void main(String[] args) {
LabCourse oop = new LabCourse("CSBP219", "E1-3010");
System.out.println(oop.outline());
}
}
class CourseShell {
protected String code;
CourseShell(String code) {
this.code = code;
}
public String outline() {
return code;
}
}
Chain constructors to reuse initialization logic before layering on polymorphic features.
Practical example
Timed notice augments a base notice with schedule information.
public class TimedNotice extends Notice {
public TimedNotice(String message, String time) {
super(message + " at " + time);
}
public static void main(String[] args) {
TimedNotice notice = new TimedNotice("Quiz", "10:00");
System.out.println(notice.text());
}
}
class Notice {
private final String message;
Notice(String message) {
this.message = message;
}
public String text() {
return message;
}
}
Implement interfaces and rely on dynamic dispatch to broadcast updates to many channels.
Practical example
Dispatcher iterates over different channels while calling one polymorphic method.
public class ReportDispatcher {
public static void main(String[] args) {
ReportChannel[] channels = { new EmailChannel(), new SmsChannel() };
for (ReportChannel channel : channels) {
channel.send("Grades posted");
}
}
}
interface ReportChannel {
void send(String text);
}
class EmailChannel implements ReportChannel {
public void send(String text) {
System.out.println("Email: " + text);
}
}
class SmsChannel implements ReportChannel {
public void send(String text) {
System.out.println("SMS: " + text);
}
}