CS261, Spring 2024

CS261 Outline

Spring 2024

Welcome to CS261

  • Each module consists of a series of activities.
    • Not every assigned activity requires you to submit something for grading. Nonetheless, you are expected to do them all.

KEYS TO SUCCESS IN THIS COURSE:

  • READ THE SYLLABUS

    The syllabus lays out the basic course policies. It tells you what you need to do to earn a passing grade. It tells you when you need to have done that by. It tells you how to get in touch with me if you run into problems.

  • HAVE A SCHEDULE

    You have the freedom to schedule your own time in this course, but you DO need to set up a schedule. Don’t forget that this course exists and that you are registered for it. Don’t think you can repeatedly set it aside for weeks at a time and make up the time later.

  • IF YOU DON"T UNDERSTAND SOMETHING, ASK QUESTIONS

    In a web course, my role as Instructor changes from “lecturer” to “tutor”. You can ask questions in the course Forums. You can send me email. You can also contact me during office hours. You’ll find more information on these options in the syllabus and other documents on the Course Policies page.

    Some people are too shy to ask questions. Some are too proud to ask questions. My advice to both groups is to get over it! Part of being educated is knowing how to exploit your available information resources. In this course, I am one of those resources.

1 Getting Started

Overview

This first module provides a preview of the major differences that students formerly trained in C++ or Python will encounter in switching to Java.

Objectives

Upon completing this module, students will

  • Be able to anticipate key differences between Java and their former programming language.
  • Understand the steps in compiling and executing Java programs.
  • Be able to assemble multiple Java source files into a project.
  • Have selected, installed, and be prepared to use a suitable IDE for programming in Java.
2 Java Basics
2.1 Primitive Types and Control Flow

Overview

This module covers the basic collection of data types and statements in the Java language.

Objectives

At the end of this module, each student should

  • Be familiar with the primitive data types of Java.
  • Be familiar with the Java String type.
  • Be able to write simple (single-class) Java programs.
2.2 Basic I/O

Overview

Obviously, every programming language needs to provide some mechanism for I/O, but I/O may be the most idiosyncratic feature of any programming language.

No matter what prior languages you have used, Java’s I/O will likely appear new and strange.

Objectives

At the end of this section, students should be able to

  • read and write fundamental data types via files and consoles,
  • read and write formatted string and numbers, and
  • capture and process common I/O exceptions.
2.3 Classes

Overview

Classes are essential to Java, more than in most programming languages.

Classes allow a programmer to extend the type system, introducing their own new data types to their coding. The skillful use of classes is essential to getting clean designs & readable code.

Objectives

At the end of this module, students should be able to

  • Declare and implement classes.
  • Understand the distinction between public and private members.
  • Write function methods and exploit their ability to access private data.
  • Be able to read Java API documentation to see what classes are already available and how to use them.
Activities
  1. reading Read TBD
  2. lecture Read: Classes and Objects: Commentary
  3. reading Read Packages
  4. lecture Read: Packages: Commentary
  5. slides An Introduction to the Java API
  6. lecture Read: Unit Testing
  7. asst Assignment: Classes and Objects
  8. discuss What Did I Miss? (discussion board in Canvas)
3 In the Java Style
3.1 Inheritance

Overview

Inheritance allows us to define groups of classes that share a common interface, but still do different things (or do things differently).

Unlike most other programming languages, inheritance is pervasive in Java. Every class you write or use in Java inherits at least part of its interface from other classes.

Objectives

Students completing this module will be able to

  • Declare a class as a subclass of another.
  • Understand the idea of abstract classes and interfaces.
  • Declare a class that implements an interface.
  • Make use of classes based upon a knowledge of the interfaces it implements and the superclass that it inherits from.
  • Understand the purpose of generics nad be able to use them in programming.
4 Exploring the Java API
4.1 Collections

Overview

In this section we examine the various containers of other data available to us through the Java API.

Objectives

Students completing this module will be able to:

  • Associate the containers that they are accustomed to use in C++ or Python with their closest Java equivalent.
  • Be able to add, remove, and access data in common container types.
Activities
  1. reading Read Introduction
  2. reading Read Interfaces
  3. lecture Read: Interfaces: Commentary

  4. reading Read Implementations
  5. lecture Read: Implementations: Commentary
  6. reading Read Algorithms
  7. asst Assignment: collections

  8. discuss What Did I Miss? (discussion board in Canvas)
4.2 Misc.

Overview

Finally, we end up with some miscellaneous elements provided in the Java API that most programmers should be aware of.

Objectives

A student completing this module will be able to:

  • Manipulate paths and files without treating everything as ordinary strings.
  • Be aware of the capabilities provided for interacting with the underlying machine environment.
  • Employ regular expressions for pattern matching in strings.
5 Finishing Up
Activities
  1. asst All assignments due by end of this day. Due: 04/22/2024
  2. exam Take the exam: Final Exam (in Canvas, 2 hrs) 04/24/2024 - 04/25/2024
Symbol Key
conference Conference
slides Slides & Lecture Notes
text Textbook readings
exam Exam
lab Lab Assignment
asst Assignment
project Project
unix CS252 (Unix) Assignment

All times in this schedule are given in Eastern Time.