This module seeks to progress from the largely procedural approach to programming learnt in Programming Languages 1 towards working more fully with an OO environment. The module is more advanced than Programming Languages 1, will run at a faster pace and is conceptually more demanding. A full range of OO concepts will be studied and students will be expected to exploit these in their Java programs. Students will also progress from compiling and running code at command level to developing programs within the Eclipse Integrated Development Environment.
Week 1 will comprise five lectures but no lab classes. The number of lectures will be reduced to two from week 2 when lab classes will also be provided. Material is planned for the following weekly order, although the precise timing will be flexible to accommodate the needs of the group:
1 Introduction and essential revision (1 lecture).
Reinforcement of static methods (1 lecture).
Introduction to Exceptions. (1 lecture).
Mechanics of classes. Scope and lifetime of variables of primitive data types (1 lecture).
Introduction to Object Oriented Programming, objects, object properties, object operations, instance variables, instance methods. A class as a pattern for objects. (1 lecture).
2 Arrays of arrays, also known as 2-D arrays. (1 lecture).
Example program using OO. Introduction to UML class diagrams. Keyword this. (1 lecture).
The Eclipse Integrated Development Environment. (lab classes).
3 Encapsulation, public, private, setter and getter methods, constructors (1 lecture)
Reference variables, simulating the effect of call by reference. (1 lecture)
4 Strings, the class String, methods provided by the class String, String objects, String arrays, String input and output, StringTokenizer class. (1 lecture)
Objects in more detail, scope and lifetime of objects, arrays of objects. (1 lecture).
5 IS-A relations, inheritance, super classes, sub classes, use of constructors with inheritance, method overriding, the qualifier protected, inheritance hierarchies, class Object. (1 lecture)
ArrayLists, Wrapper classes, autoboxing, auto-unboxing. (1 lecture)
6 Input and output, older approach using BufferedReader and BufferedWriter, newer approach using Scanner, input and output using files. (1 lecture)
Packages, relation of packages to file directories, CLASSPATH. (1 lecture)
7 Inheritance revisited (discussion of inheritance in more depth), final classes, final methods, abstract methods, abstract classes, polymorphism, dynamic binding, interfaces, the toString ( ) and equals ( ) methods. (2 lectures)
8 Reinforcement of week 7 material - examples etc. (1 lecture)
Inner classes, definitions of: class, field, member, method, object and variable. (0.5 lecture)
Exceptions revisited, exceptions as classes, the keywords throws and throw . (0.5 lecture)
9 HAS-A relations, composition and aggregation. (1 lecture)
Reinforcement of difficult topics. (1 lecture)
10 Enumerated types. (1 lecture)
Review of important Java packages. (1 lecture)