What do you think of the Java programming language overall?
Compare it to another language you know. 
What is object-oriented programming? How does it differ
from procedural programming? 
Procedural programming is action-oriented: the code is a sequence of
procedures, and the data structures are passed as parameters to the
procedures. The focus is on the 'verbs'. In contrast, object-oriented
programming is data-oriented: code is organized into classes, centred
around objects, and the procedures are treated as methods within each
class. The focus is on the 'nouns'.
Describe and contrast the four options we have in Java for
access modifiers on attributes/methods. 
only methods in this class can access
methods in this class and this package can access
also subclasses can access
anyone can access
What is the effect of the final keyword on
instance variables?  Constant: cannot change the value of the variable
methods?  Subclasses cannot override (redefine) the method
classes?  Cannot be subclassed
What is an interface in Java? What is an abstract class?
What's the difference? Describe an example of each (you may come up with your
An abstract class is not meant to be instantiated directly. An abstract
superclass can be used as a way of organizing its subclasses under one
category. For example, Dog, Cat, and Cow all are within the Mammal category.
It makes sense to have specific instances of Dog, Cat, and Cow, but not of
Mammal. Mammal is the abstract superclass.
An interface is a named set of methods, for instance the ActionListener
interface specifies the actionPerformed() method and advertises that a class
knows how to respond to action events. Interfaces specify functionality,
i.e., what a class knows how to do. Abstract superclasses specify identity,
i.e., what a class is. Multiple classes that inherit from different
superclasses may implement the same interface, but in Java multiple
inheritance is not permitted.
Name and briefly describe the features of at least 4
Swing widgets (i.e., subclasses of JComponent).
If you can't remember the exact name of the class, describe the
widget in as much detail as you can.  Many to choose from: JPanel, JFrame, JButton,
JCheckBox, JComboBox, JRadioButton, JLabel, JTextField, JPasswordField,
JTextArea, JMenu, JMenuItem, JSlider, JProgressBar, ...
What is object serialization in Java? Describe
a situation where serialization might be useful. 
Serialization converts Java objects into byte streams that can be sent across
any I/O channel. Objects can be serialized if their classes implement the
Serializable interface and if all its non-transient instance variables are
serializable. Primitive types (int, char, etc.) and arrays of primitive types
are serializable. Any kind of inter-process communication may benefit from
object serialization: e.g., a client-server restaurant ordering system may
wish to send objects that represent customer orders over a network I/O
What is a component framework? Why are they cool? Describe one
such framework in detail (it need not even be computer-related). Describe
a couple example components and what you could do with them. 
What is an Android Activity? Is it a complete application?
Describe an example. 
An Activity is the UI for one focused user endeavour, e.g., one screen
or dialogue window.
Android applications may be composed of multiple Activities, background
Services, BroadcastReceivers, and ContentProvider databases.
Why do Android applications not have a main() method? 
Modular component architecture: applications are not monolithic but
may have several entry points. This is so other apps can directly call
individual Activities within the application, rather than having to go
What are Android string resources? Why are they cool? 
Name-value pairs, stored in res/values/strings.xml. In the code or
UI layout, refer to strings via their resource IDs, rather than hard-coding
them in. This facilitates localization/translation into other languages.
Design a class hierarchy of your own choosing, with
an abstract superclass and at least two concrete subclasses.
Design attributes and methods appropriate for each class and
draw a UML class diagram. 
Design a method that takes advantage of the polymorphism
in this class hierarchy, and explain how it does so.
The polymorphic method need not live inside any of the classes. 
For each of the three categories of design patterns in the
"Gang of Four" book, name at least three example patterns (for a total
of nine patterns). For each pattern you choose, describe it in words and give
an example or analogy illustrating it.
Behavioural:  observer, mediator, chain of responsibility, iterator,
Write a complete Java program that reads in a file "input.txt",
removes all digits, and outputs the result in the file "output.txt".
Include full doc-comments with pre-/post-conditions. 
A BankTransaction consists of an account number, date,
dollar amount, and a flag that indicates whether it was a withdrawal or deposit.
Write a complete Java class defining a BankTransaction,
including attributes and two constructors (one with a full set of
parameters, and one with no parameters at all). Be sure to do
error-checking of all input parameters. To keep things simple, no set/get
functions are required.
The java.util.Date class stores a date/time object; the
default constructor returns the current date/time. 
Add a copy constructor to the implementation.
Check for null references and other errors. 
Design a console-based networked chatroom in Java.
Users may be able to join and leave the chatroom, and any line of text entered
by any user is broadcast to all other users.
What classes will you need? What methods might those classes
have? Describe how you would handle having multiple users connected
at the same time. Describe in detail what should happen when a new user
tries to connect to the chatroom. 
We wish to design a system that tracks the location of
public buses in real-time and updates displays at bus stops
informing riders of how long they'll need to wait for the next bus.
Draw a UML use-case diagram for this system.