You are responsible for the following for CS1 Quiz 2
- Liang - Chapters 3, 5.1, 5.3, 5.9, 7.4.4, 7.4.5, 7.5
- Objects (Reference Variables)
- Objects (reference variables) and how they differ from
primitives
- Memory diagrams for objects (reference variables) and
primitive types
- Declaring and instantiating objects
- How do you declare an object (reference variable)?
- Why do objects need to be instantiated as well as
declared?
- Use of new
- Providing information for setting the state of the new
object
- Reading javadoc to help with above
- Using objects
- Reading javadoc
- Which methods return values?
- Which methods require that you provide
information for the object to do it's work? What
kind of values does it need?
- How do Strings differ from chars?
- Know how to use the Stringmethods from lab,
such as toUpperCase, equals, indexOf,
substring,
- What does "==" mean when comparing two String
variables?
- How does comparing two String variables using
"==" differ from the equals method?
- Control Structures
- Selection Statements
- evaluating boolean expressions
- Relational Operators: <, <=, >, >=, ==, !=
- Logical Operators: &&, ||, !
- Know the precedence of relational and logical
operators
- Be able to write boolean expressions
- Be able to evaluate boolean expressions
- Be able to declare boolean variables and
assign them values
- if
- Sytax of all of the different forms an if
might take
- Nested ifs and dangling elses
- Be able to trace any form of if statement
(i.e., provide the output from it's execution)
- switch
- Sytax
- Use of break
- Be able to trace a switch statement (i.e.,
provide the output from it's execution)
- Be able to write an equivalent single if statement
from a switch statement.
- Be able to write an equivalent single switch
statement from an if statement, if it's possible.
- Know when you can't do the above!
- Program flow
- Be able to trace/read/provide output from any Java
application that contains sequential and/or selection
structure and/or method invocations.
- Be able to provide memory diagrams for the variables used in
the above.
Phil White
October 5, 2004
http://www.cs.rit.edu/~paw/cs1/Quiz3.html