Information on Test 1, CS2110, Spring 2011

 [Updated] Monday, 2:10pm

The test will be held on Wednesday, Feb. 16, in class at your regular class-meeting time.
Be sure to come on time!

Readings from the MSD textbook:

All slides from this part of the course:

Topics in readings that won't be on the test:

There might be coding questions (large or small) on the following:

Summary of topics:

Java Review and Issues:
  1. Class concepts (slides and Chapter 3)
  2. Primitive types vs. object references
  3. Object references (This is in both Chap. 2 and Chap. 3)
  4. Comparable and Comparator: see slides or pages 641-647 in the MSD book
  5. Arrays -- no direct questions on arrays!
  6. ArrayList -- you may have to use these in your answers on other topics
  7. Scanner-- no direct questions on Scanner!
  8. Review info on Java methods in Section 3.2.2
  9. No questions on these topics:  Exceptions, URL class, reading from files

SW Engineering, Chap. 1:

  1. What issues are more important in Software Engineering (SE) in industry than in programming-in-the-small (i.e. what we do in class)?
  2. Phases in the software development lifecycle
  3. Problem specifications or requirements
  4. Design (see the textbook for some of this)
  5. Execution-based Testing

OO Design and Programming, Chapters 2 and 3:

  1. Principles of the OO approach
  2. Reference variables to objects
  3. Basics of inheritance (terms, ideas, the idea of "Is-A", substitutability)
  4. Motivations for inheritance
  5. Extending a class
  6. Java's class Object and some of its methods (toString, equals, but no questions on hashCode)
  7. Using a superclass reference to point to subclass objects
  8. Run-time polymorphism and references of the superclass type Interfaces The "forms of inheritance" listed on pp. 53-55 and in slides.  Abstract classes -- defined only for creating subclasses by extension; not possible to create an instance

[Updated]Methods in String and ArrayList I'll Assume You Know

String class

int compareTo(String anotherString) --
          Compares two strings lexicographically.
boolean contains(CharSequence s) --
          Returns true if and only if this string contains the specified sequence of char values.  (A String "is-a" CharSequence.)
int indexOf(String str) --
          Returns the index within this string of the first occurrence of the specified substring.
int length() --
          Returns the length of this string.
String substring(int beginIndex) --
          Returns a new string that is a substring of this string.
String substring(int beginIndex, int endIndex) --
          Returns a new string that is a substring of this string.
String toLowerCase() --
          Converts all of the characters in this String to lower case
String toUpperCase() --
          Converts all of the characters in this String to upper case
String trim() --
          Returns a copy of the string, with leading and trailing whitespace omitted.
         
ArrayList<E> class

Constructor:  ArrayList<E>(another-array-List) --
            creates a new list that contains all the elements in the specified list
boolean add(E e) --
          Appends the specified element to the end of this list.
void clear() --
          Removes all of the elements from this list.
boolean contains(Object o) --
          Returns true if this list contains the specified element.
E get(int index) --
          Returns the element at the specified position in this list.
int indexOf(Object o) --
          Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
E remove(int index) --
          Removes the element at the specified position in this list.
boolean remove(Object o) --
          Removes the first occurrence of the specified element from this list, if it is present.         
int size() --
          Returns the number of elements in this list.