The University of Sheffield
Department of Computer Science

COM1003 Java Programming

Summary This module introduces programming concepts through the Java programming language. Program design and the use of testing to drive program creation are also covered. Initial focus is placed on the structured aspects typical of many programming languages: the ideas of a sequence, selection and repetition. The object-oriented approach to building large software systems from components is then presented. Throughout the module, emphasis is placed on the practice of writing well-structured and readable programs to solve problems.
Session Academic Year 2018/19
Credits 20
Assessment Assessment will be via MOLE quizzes, short programming assignments and larger programming assignments. There will be no written examination for this module.
Lecturer(s) Dr Siobhán North & Dr Mari-Cruz Villa-Uriol
Resources
Aims
  • to develop an understanding of computers and computer program execution;
  • to develop an understanding of program elements such as variables, types and objects;
  • to develop skills in problem solving and program design;
  • to develop an understanding of abstractions such as methods and control structures;
  • to introduce notions of data abstraction and encapsulation;
  • to provide a grounding in object-oriented programming techniques;
  • to inculcate a component-based approach to large program design;
  • to introduce key aspects of the Java API and Swing;
  • to develop an understanding of data structures and algorithmic complexity;
  • to establish a sound and consistent programming style in Java;
  • to provide experience of collaborative work on solving programming problems;
  • to introduce unit testing and develop an understanding of how to write simple automated tests.
Objectives By the end of this course, students will:
  • understand the difference between a variable, value and object;
  • understand procedural abstraction and the passing of arguments and results;
  • understand how to structure basic Java programs to solve simple problems;
  • understand how to design an encapsulated data type with private and public aspects;
  • understand what is meant by object-oriented and component-based programming;
  • understand the time and space trade-offs between different implementations of collections;
  • understand the basics of visual application programming using Swing;
  • demonstrate the ability to work as part of a small group in order to solve a programming problem;
  • demonstrate an understanding of how to produce unit tests for checking that written code is working as expected.
Content Introduction to Java programming
  • variables and assignments;
  • datatypes;
  • classes and objects;
  • the Sheffield package - EasyReader, EasyWriter, EasyGraphics;
  • introduction to the Lego Mindstorm Robots;
  • problem solving and program design
Object Oriented Programming
  • classes;
  • methods and parameters;
  • object composition;
  • inheritance;
  • polymorphism.
Object-oriented programming and design
  • information hiding;
  • abstract data types;
  • refactoring.
Testing
  • JUnit.
Advanced programming
  • exception handling;
  • threading;
  • recursion.
Components of the the Java API
  • Input and output;
  • Collections;
  • Swing;
  • specifying and developing a graphical user interface.
Teaching Method Lectures and laboratory sessions.
Feedback
  • On assignment hand back sheets
  • In lectures (going through class test Q&As)
  • In lab classes (going through exercises and assignment problems).
Recommended Reading

You should not rush out and buy any or all of these books. Programming is essentially a practical subject and textbooks are of limited use when getting started. The Java Tutorials, which you can download free from
http://www.oracle.com/technetwork/java/javase/java-tutorial-downloads-2005894.html

will probably be all the support you need. Nevertheless here are a few suggested textbooks if you feel the need for one.

For beginners:

  • Java A Beginners Guide Java A Beginner's Guide (7th Ed.) by Herbert Schildt. Published in 2017 by McGraw-Hill Education - Europe ISBN: 9781259589317

For students who have some previous programming experience (in any language):

  • Core Java for the Impatient. Cay S. Horstmann Core Java for the Impatient (2nd Ed.) by Cay S. Horstmann. Published in 2017 by Pearson Education (US) ISBN: 9780134694726

A useful reference guide but not light reading:

  • Java in a Nutshell (6th Ed) by David Flanagan. Published in 2014 by O'Reilly Media, Inc, USA ISBN: 9781449370824 but the 7th Edition is due out at the end of December so it might be worth waiting for it

An excellent guide to coding style