Discussions and Exercises
On a piece of paper, list for each student:
o name, major, any CS-related work experience
Read the following:
http://www.agilenutshell.com/
o (entire sidebar, don’t stop after “in a nutshell”)
http://anh.cs.luc.edu/170/Kindergarten.html
In a small group, discuss the following questions. For
participation points, turn in one page with your answers.
o What seems surprising about the Agile process?
o What do you think will be hard about Agile?
o What aspects of Agile sound like fun?
public void doTrace() {
int num = 5;
int mult = 3;
while (num > 3) {
num -= mult;
mult--;
}
System.out.println(num);
}
public void doSomething() {
int number = 2;
int count = 0;
while (number != 7) {
count++;
if ((number % 2) == 0)
number += 3;
else if (number > 8)
number -= 1;
else
number++;
}
System.out.println(count);
}
Turn this in for class participation credit
Common scenario:
o Students raise hand. Point to code, say they don’t understand why
it’s not working.
public void someFn() {
if (some condition)
do some action;
}
o assumption: method is called
o assumption: if condition is true
o Test your assumptions! How? println OR use debugger
• GUI program… println may be better
• repeated code… println may be better
• otherwise… debugger may be better
Class
Object
Instance
this
new
Constructor
Default constructor
Access (private/public/protected)
static variable/static method
parent/child; superclass/subclass
abstract class/pure virtual function
Turn this in for class participation credit
/*
* Why should this class not be abstract?
*/
public abstract class Student1 {
private String name;
private ArrayList<String> courses;
public Student1(String name) {
this.name = name;
// Note the use of diamond, allowed if Java can
// determine type
courses = new ArrayList<>();
}
public void register() {
courses.add("CSCI306");
}
}
Turn this in for class participation credit
/*
* Is this a valid interface? (i.e., follows rules)
*
* What do you think about the name of the interface?
*/
public interface Student2 {
public static final int MAX_COURSES = 8;
public void register();
public void attendClass();
}
/*
* This interface is not valid. Why?
*/
public interface ClassTaker {
private String whichClass;
public void attendClass();
}
/*
* Is this interface valid in Java 8?
* Would it have been valid prior to Java 8?
* Is this a best practice in Java 8?
*/
public interface ClassTaker2 {
public void attendClass() {
System.out.println("Attending class
today");
}
}
/*
* Should this be a class or an interface?
*/
public abstract class OperateCar {
public abstract void speedUp(double amount);
public abstract void slowDown(double amount);
}
You know, the more time I spent in industry the better I've
understood what a strong advocate you are for the students
in the CS program. You genuinely want to see us succeed in
our careers, above all else.
© Copyright 2026 Paperzz