CMP 163 Object Oriented Programming
BCIS, First Year, Second Semester
Course Objectives
This course aims to provide an introduction to Object Oriented Programming concept using Java.
At the end of this course, students should be able to write Java applications utilizing the object-
oriented concepts introduced in this course.
Course Description
The course covers the basic fundamentals of Java programming like classes, objects, inheritance,
exception handling, etc. as well as advanced topics like interfaces, polymorphism,
multithreading, file-handling and java swing. The topic covered will also introduce the Object
Oriented paradigms like Inheritance, Abstraction, Encapsulation and Polymorphism using Java.
Course Outcomes
By the end of this course, students should be able to:
• understand the concept of OOP as well as the purpose and usage principles of
inheritance polymorphism, encapsulation and method overloading;
• identify classes, objects, members of a class and the relationships among them needed
for a specific problem;
• create Java application programs using sound OOP practices (e.g., interfaces and
APIs) and proper program structuring (e.g., by using access control identifies, automatic
documentation through comments, error exception handling).
Prerequisite
This is the first course on Object-Oriented Programming using Java. Students are not expected
to be familiar with either Object Oriented Programming or Java but knowledge of basic
programming concept is required. Students should have successfully completed the
Programming Language (CMP 161).
Course Contents
Unit I: Introduction to Java 3 hours
Java Language and History, Features of Java (Object-Oriented, Robust, Secure, Architecture
Neutral, Portable, Interpreted, Multithreaded, Dynamic, Performance), Common
Misconceptions about Java, Java Virtual Machine, JDK, JRE, Java Program Structure
Unit II: Java Programming Basics 4 hours
Keywords and Identifiers, Java’s Primitive Data Types (integer, floating-point, character,
boolean), Literals, Variables, Variable Declaration and Initialization, Scope and Lifetime of a
Variable, Operators (arithmetic, increment-decrement, relational-logical, assignment, bitwise),
Type Casting, Operator Precedence, Java Expressions, Strings, Arrays, Control Statements (if
statement, nested ifs, if-else-if, switch),Loops ( for, while, do-while, break, continue), Nested
Loops
1
Unit III: Classes and Objects 6 hours
Introduction to Object Oriented Programming, Functional vs Object-Oriented Programming,
Features of Object-Oriented Programming, Classes and Objects, Constructors, Methods and
Instance Variables, Methods Arguments and Return Values, Method Overloading, Access
Modifiers, Static and Final Members, Garbage Collection and Finalizers, this keyword, Inner
Classes
Unit IV: Inheritance, Interfaces and Packages 8 hours
Introduction, Member Access and Inheritance, Constructor and Inheritance, super keyword,
Multi-level Hierarchy, Method Overriding, Polymorphism and Dynamic Binding, Abstract
Classes, Final Classes and Methods, Object superclass, Object Wrappers and Autoboxing,
Interfaces, Creating and Implementing an Interface, Interface and Abstract Classes,
Implementing Multiple Interfaces, Extending an Interface, Packages, Packages Scope, Importing
Package and Class, Static Imports, Creating a Package
Unit V: Exception Handling and Multithreading 8 hours
Exceptions and Errors, Exception Hierarchy, Catching Exceptions: try and catch, Catching
Multiple Exceptions, finally Clause, Throwing an Exception (throw, throws), Analyzing Stack
Trace Elements, Java’s Built-in Exceptions, Creating Exception Subclasses, Introduction to
multithreading, Thread Class and Runnable Interface, Multiple Threads, Interrupting Threads,
isAlive() and join(), Thread Priorities, Synchronization, Deadlock, Thread Communication,
Suspend, Resume and Stop Threads
Unit VI: Java IO 6 hours
Byte and Character Streams, Byte Streams andCharacter Streams, Reading from and Writing to
Console, Reading from and Writing to File, InputStream, OutputStream, File Input Stream, File
Output Stream, DataInputStream, DataOutputStream, BufferedInputStream,
BufferedOutputStream, Reader, Writer, FileReader, FileWriter, BufferedReader, BufferedWriter,
Random-Access Files, Files and Directories
Unit VII: Java Collections and Java API Library 7 hours
Introduction to Java Collection Interface, List, Set, Map, ArrayList, LinkedList, HashSet,
HashMap, Iterators, String Handling (equals(), substring(), replace(), indexOf(), lastIndexOf(),
replace(), trim(), toUpperCase(), toLowerCase()), String Concatenation, StringBuffer and
StringBuilder, Byte, Short, Integer, Long, Float, Double, Boolean class, Calendar and
SimpleDateFromat class, Formatting Strings, Numbers, Date and Time, Random class
Unit VIII: Java Swing 6 hours
Introduction, Components and Containers, Layout Manager, Text Input and Choice
Components, Menus, Dialog Boxes, Event Handling
Lab Works
1. Installation of JDK and Netbeans/Eclipse
2. First program using Java
3. Variables, Data-type, Strings, Arrays, Control Statements and Loops
4. Classes and Objects, Inheritance
5. Interface and Polymorphism
6. Exception Handling
2
7. Java IO - 1
8. Multithreading
9. Using ArrayList, HashMap, Iterators
10. String, StringBuffer, Calendar, Random
11. Java Swing
Basic Text
Schildt, H. &Skrien, D. Java Fundamentals – A Comprehensive Introduction. New Delhi:
Tata McGraw Hill.
References
1. Deitel, A. M. &Deitel, P. J.Java How to Program.New Delhi: Pearson-Prience Hall, India.
2. Horstmann, C. S. &Cornell G, Core Java Volume 1 – Fundamentals – Sun Microsystem