COSC 1320 Introduction to
Computer Science II
Having as many practices as possible is the right way to learn a
language!
There is NO lab for this course, so please do compile and modify
the provided examples!
Spring 2015
- Instructor: Guoning Chen
- Location: Classroom Business Building
(CBB) 104
- Time: Tue/Th. 10am~11:30am
- Office hours: Tue/Th. 11:30am~12:30pm
at PGH 566
- TAs:
- Xifeng Gao office hours: Monday 3-4pm, Friday
1-3pm; Location PGH 301
- Marzieh Berenjkoub office hours: Tu/Thur
4-6pm; Location PGH 314
- Lieyu Shi office hours: Tu/Thur 2-4pm;
Location PGH 314
- There will be a review section on EVERY FRIDAY from
11:30am to 1pm at room PGH376.
Course summary
This course aims to introduce the students the
principles of object-oriented programming with the examples of C++ and Java
languages.
The goal is to prepare students with the
fundamental programming skills of C++ and Java for the future large-scale OOP
tasks.
Prerequisites:
COSC 1410 Introduction to Computer Science I
Textbooks (required):
1) Absolute C++ (5th edt.), 2) Absolute Java (5th
edt.), Walter Savitch, Addison-Wesley.
Recommended Reading:
- C++ How to program , 8/e, Deitel and Deitel,
2012, Prentice Hall, ISBN-10: 0132662361 , ISBN-13: 9780132662369
- Java How to Program: Late Objects Version, 8/e,
Deitel, 2010 , Prentice Hall,ISBN-10: 0136123716 , ISBN-13:
9780136123712.
- Java Programming: Comprehensive Concepts and
Techniques, 3rd Edition
- Shelly, Cashman, Starks, Mick, 2006 Course
Technology, a division of Thompson Learning.
- Object-Oriented Software Engineering Using UML,
Patterns, and Java, 3/E, Bruegge & Dutoit, 2010, Prentice Hall.ISBN-10:
0136061257, ISBN-13: 9780136061250.
Software and IDE (tutorials should be
available in the blackboard learn):
- Microsoft Visual Studio
2012/2010/2008/2005 (for C++ on windows)
- Xcode (for C++ on Mac)
- Eclipse (for Java)
- UML editor (TBA)
Detailed syllabus
is also available in the blackboard learn.
Schedule and Materials
Come and visit often as the materials will be
updated without notice.
Week 1 (Ch 6~8, except 7.3)
Main goal: review OOP principles,
important concepts of class, object, encapsulation, abstract data type (ADT),
constructors,
Knowledge points that you should
know:
- What is the difference between structured programming and object-oriented
programming? (algorithm centric vs. object centric)
- What is a class and its relation to object? (A class is a user-defined
type that consists of both member variables and functions. An object of a
defined class is its instance or variable)
- How to access member variables and functions? (Define an object and use
dot operator "." to access only "public" members)
- How to implement member functions outside of the class body? (
return_type class_name::function_name(argument list) {function
body}
)
- How to use "public" or "private" to limit the access to certain members
of a class? and Why? (to achieve encapsulation)
- NOTE THAT the default access without specification is "private" for a
class, but "public" for a structure!
- What is an abstract data type (ADT)?
- What does encapsulation mean? (enclose both attributes and behaviors,
information and implementation detailed hidden, good interface and
comments...)
- Can you tell the difference between structure and class now?
- How to define and initialize an object from a pre-defined class?
(class_name object_name(initial parameters);)
- What is the way to define a constructor (pp.276, must have the
same name as the class, NO RETURN TYPE)
- What does a constructor do? Can it be defined under a "private"
section?
- How many different constructors one class can have? (default constructor,
overloaded constructors)
- How to initialize member variables in a constructor? (direct or via an
initialization section)
- How to manage dynamic memory allocation? (see the additional examples,
new
operator)
- Why do we need destructor and how to define it?
(
~class_name(){body};
NO RETURN TYPE, ARGUMENT LIST IS
ALWAYS EMPTY)
- Using
"const
" in class and define member functions with
"const"
type. Why do we need that? (pp.295, Do not want a
member function to change member variables)
- Using "static" members in class. Why do we need that? (pp.303, All the
objects of the class shared one variable, e.g. a token for take or a
counter, it is better to be defined as "static")
- Overloaded operator functions. Why do we need that? (pp. 322, apply '-',
'+', '>', '==', etc. to objects that are not basic types, pp.343 the
rules)
- What is the difference when overloading operator functions as the member
functions vs. non-member functions? (one parameter less!)
- operator '=' is overloaded when the member variables have
pointer type!
- Friend functions (especially for overloaded operators). How do we define
them? Why do we need that? (pp.338, Auto type conversion +Access other
class private members directly, not-so encapsulated, though)
Additional examples: (Again, please
compile and play with the following examples, try to break the rules and see
what would happen!)
An example of course grade for students, cpp1,
cpp2,
(constructors, destructor, dynamic memory allocation)
An example of a clock class cpp3
(constructors and operator overloading)
An example of car cpp4
(constructors)
A different employee example cpp5
(constructors, destructor, dynamic memory allocation, dynamic creation of
objects)
Please be familiar with your selected
programming environment. Be sure to compile and execute the examples
of the textbook and the course webpage!
Week 2 (Ch.14) Inheritance, UML
intro
Main goal: understand the mechanism
and benefits of inheritance of OOP, and know how to implement it in C++. Basic
knowledge on UML (will get familiar with it through subsequent exercises)
Knowledge points that you should
know:
- How to do composition and why it is useful? (To build up complex objects
by "compositing" many basic objects, like building a car. In OOP,
you use the objects of pre-defined classes as the member
variables.)
- How to initialize the composited objects? (see the additional slides in
the review of last week)
- What is the inheritance and why is it useful? (see the additional slides
below--programming efficiency, software maintenance, resource reuse,
etc.)
- What is a base (or super) class and what is a
derived class?
- How to specify inheritance relation between classes in C++?
(
class DerivedClass : <Access> BaseClass
)
- What in the base class can be inherited by the derived class? (pp.
620, everything in the public section except constructors, destructor,
and assignment operator)
- The member functions of the derived class cannot access all
private member variables and functions inherited from the base
class!(pp.626)
- Do we need to specify the inherited members from the base class? (No,
they are automatically inherited)
- Can we modify (or redefine, or overwrite) the inherited members? (Only
the inherited member functions)
- If we modify the types of the inherited variables, it is called
hiding not overwriting.
- How can we initialize the inherited member *variables* from the base
class in the derived class? (pp. 624, in the constructor, do
DerivedClass(argument list) : BaseClass(arguments),
...
)
- Can you tell the difference between overwrite and overload a function?
(whether the new function has the same argument list with the old one or
not)
- What is the UML (Unified Modeling Language)
- What does it do? How can it help clarify and represent different
relations of classes?
- What we need at this moment is the inheritance relation and the
aggregation relation (e.g. object composition)
- It is a useful tool for software engineering before you actually start
coding (and for business management as well!).
Additional materials:
- review of materials in last week (pptx).
- slides for the inheritance (pptx).
- Examples shown in the class (cpp1,
cpp2,
cpp3)
- A different employee example (cpp4).
Week 3 (Ch.15) Polymorphism and
virtual functions
Main goal: Get familiar with the
Polymorphism mechanism of OOP and how to achieve that in C++.
Knowledge points that you should
know:
- What is a copy constructor of a class (with the
form "
ClassName(const ClassName & in_obj)
;".
It has to be a reference to the input
object!)
- What does a default copy constructor do? (default
copy constructor is created implicitly, and it does a member-wise
assignment)
- When do you need to explicitly specify a copy
constructor? (when there are pointer type of
the member variables)
- When will a copy constructor be called? (see the
slides)
- What is polymorphism? (same message with different outcomes from
different objects, it is typically related to
inheritance!)
- Why do we need that? (try to understand the Figure example in the
slides)
- Why do we say "polymorphism" can be used to achieve software reuse? (pay
attention to the encapsulation principle in the
Figure example, try to fix the interface of using certain class and its
child classes.)
- How to achieve polymorphism in C++? (there are multiple ways, but at this
moment, we focus on the "virtual function")
- How to enable the polymorphism offered by virtual functions?
(Use base type of pointers to point to the objects of derived
classes)
- How and where to specify virtual functions? (IN THE BASE CLASS, use
keyword "
virtual
" in front of the functions that will be
overwritten/redefined in the derived
classes)
- How the compiler interpret the virtual functions? (using
"LATE BINDING", i.e. the actual function that
will be called is determined in run time based on the type of the
object)
- How to define a function in the base class that does not have specific
implementation? (using pure virtual functions
virtual return_type function_name(<argument list>) =
0;)
- How to define an abstract class? (if the class contains at least one pure
virtual function, the class will be abstract).
Additional materials:
- review of materials in last week (pptx)
- slides for the copy constructor (pptx)
- slides for the polymorphism (pptx)
- copy constructor example (cpp)
- polymorphism examples, the Figure example (cpp1)
- the Thing/Animal example (cpp2),
this example also shows the virtual destructor, remove the keyword
"virtual" and see what you will get
- the modified employee (cpp3)
- one simple example of virtual destructor (cpp4)
- an example of pure virtual function
and abstract base class (cpp5)
Week 4 (Ch.18) Polymorphism reviews
and Exception Handling
Main goal: Get familiar with the
exception handling in C++.
Knowledge points that you should
know:
- What is the difference between if condition and
exception handling? (exception handling separates the "exception" from
"normal", but if condition does not)
- What is the benefit of using exception handling?
(separate the exception handling code from the normal code)
- How to implement exception handling?
(try-throw-catch, i.e. normal code in try,
throw exception instance when it is needed, catch the exception instance
and process it, change control flow!)
- What can be the types that
throw
throws (any pre-defined types including complex objects)
- How many parameters can each catch block has? (No
more than one! Each catch captures one type of exceptions)
- What should be the order of multiple catch
blocks? Why? (More specific exceptions go first, more general exceptions go
later because of the automatic type conversion)
- Can we throw an exception inside a function?
(Yes) Who is responsible to handle that? (the function's caller where the
try-catch blocks are defined.)
Additional materials:
- Lecture slides (exception handling pptx)
- Exception handling examples (cpp1,
cpp2)
Week 5 (Ch.16) C++ Template, Mid-term
reviews
Main goal: Get familiar with the
C++ template mechanism.
Knowledge points that you should
know:
- What is the benefit of using template and its relation to polymorphism?
(Efficient coding, another form of polymorphism)
- How to define template functions? (using the template prefix
template<class T>
, here class
means "type", T is the parameter whose values are the types, e.g. int,
float, char,...)
- How does template work? (create the instance function based on the type
of the variable, see slides for detailed explanation via examples)
- What other things need to be aware of when using template functions? (you
can have as many the type variables as you
want in the template, but each type
variable has to be used in the function. Please see slides
for more details)
- How to define class template? (
template<class T> class
class_name{};
)
- What is the requirement when defining the member functions of a class
template? (use
class_name<T>::
in front of each
function)
- How to use a class template to create an object? (use
class_name<specific type> object_name
)
- Can a class template be used to derive new classes? Any things need to be
aware of?
Addition materials:
- Lecture slides (C++ templates pptx)
- Template function examples (cpp1,
cpp2)
- class templates (ch 7.3 the std::vector
example!)
Mid-term exam reviews (pptx)
Week 6 (Mid-term exam 1 and Java
introduction)
Mid-term exam 1 on Feb.
24 at CBB 104 from 9:50am-11:20am! The exam will cover all the above knowledge
points except UML!
- Background of Java
- You need to install the eclipse IDE, it provides
both windows and Mac versions. Do you know how to compile and run a java
program in eclipse?
- Make sure you know how to add and delete a class
in eclipse. Do you know how to compile and run a java program?
- Is jave an OOP language? (yes, everything is in
certain class)
- Why do we say jave code is portable or platform
independent? (the compiler does not produce executable file but rather a
so-called "java byte code" which can be further interpreted by JVM)
- Why do we need to install a java virtual machine
(or JVM)? How does it work? (see above question)
- What is the entrance of a java program and where
should we place it? (main() function, it needs to be defined as a
"
static
" function of a class!)
- In what forms your java programs can be run?
(either stand alone program or java applet)
Week 7 ( Ch.4, Ch.5, Ch.7, Java class
and inheritance)
Main goal: get familiar with the
class definition and usage in Java; understand and know how to use inheritance
in java
Knowledge points that you should
know:
- How did you define a class in Java? any
difference from what we did in C++? (everything is class. Be careful the
placement of the access modifier)
- Can you have a global variable or function in
Java? Why or why not? (No, every variable and function has to be associated
with a class, even the basic types of variables)
- How do you create an object using the defined
class? (use "new" operator to create an object!)
- Note that there is NO POINTER in
Java!
- Do we need constructor for the classes defined in
Java? Is it different from C++? (We need constructors. They have the same
name to the class name. Their definitions in Java are similar to those in
C++)
- When should we add a no-argument constructor?
(Note that it is not always automatically added for you! It is recommended
to add the no-argument constructor for every class you define.)
- Is there a copy constructor in Java? (Yes)
- Is there a destructor for Java class? (No, Java
will collect the released memory for you. However, this still needs to be
done carefully.)
- What is the alternative way to initialize a
member variable?
- What is the restriction of different access
modifier, including "public", "private", and "protected"? (Similar to C++,
but need to consider package)
- What is the "package access"? Do you know its
difference from "protected"?
- How to use static member variables and functions
in Java? (Similar to C++. NOTE that static member function cannot invoke a
non-static function!)
- Dose Java support function overloading? How to
achieve that? (Yes, Java supports function overloading. You need to have
different signatures for the overloading function)
- Does Java support operator overloading? (NO!)
- Do you know the meaning of "equal(Classname
objectname)" and "toString()"?
- Why do we need inheritance? (Go back to see the
benefit in C++!)
- How to achieve inheritance in Java? (the
"extends" keyword, i.e. newClass extends oldClass)
- What can be inherited from in the new class? (all
public/protected members; and private member variables although you cannot
directly access them by name)
- How to override or redefine an inherited
function? (Similar to C++. They need to have exactly the same
signature)
- Can one change the return type of an overridden
method? (No, except the return type is changed from a base class type to a
derived class type)
- Can one change the access modifier of an
overridden method? (Yes, but can only make it more accessible, e.g. private
-> public, but not public->private)
- How to hide a member variable? (Same in C++)
- Do you know the meaning of "final" members or a
"final" class? (They cannot be overridden or used to derive new class!)
- How to call the constructor in the base class to
initialize the member variables inherited from the base class? (Use "super"
keyword!)
- When and where should you use "super" (It should
be the first call in the constructor of the derived class. It can be used
to call the base version of a overridden method.)
- Do you know the meaning of "this" keyword? (It is
used to call the other constructor in the same class. It also has to be in
the first line of the constructor.)
- Do you know the purpose of "Object" class in
Java? Can you draw a class diagram of Java classes?
- What are the benefits of using "Object" as the
root of all classes in Java?
- Do you know the difference between "is a" and
"has a" relation between objects? (Think about inheritance and object
composition)
- What is the purpose of the "getClass()"
method?
- How to use "instanceof" operator and how is it
different from the "getClass()" method?
Additional materials:
Review examples (pptx)
Lecture slides (pptx)
group project (.pdf)
(data)
due on Thursday (03/12
) midnight.
Can you use Java to re-implement what we have done
for the inheritance using C++ above?
Week 8 (Ch.8, Ch. 10, Java
Polymorphism and File I/O)
Main goal: Review what polymorphism
is and why it is useful, learn how to achieve that in Java and how it is
different from C++. Understand the concept of Abstract class and interface and
their usage. Revisit the File I/O in java.
Knowledge points that you should
know:
- What is polymorphism? Can you explain it based on
what we learned in C++?
- What is late binding or dynamic binding? Why it
is useful?
- What binding scheme is typically used by Java?
- How to achieve polymorphism in Java? How is it
different from C++?
- What is an abstract method and an abstract
class?
- What is an interface and why is it useful? (An
interface is not a class, but rather useful for polymorphism.)
- How to define an interface? (Use keyword
"interface", all methods do not have
definition. Therefore, an interface does not have any real
functionality)
- How to use interface? (Used as the parameter in
the argument list of a function. Use to define class)
- How to implement an interface? (Define a class to
"implement" the interface)
- Can we derive a new interface from an existing
interface? (Yes! We use "
interface B extends A1, A2, A3
{}
")
- How many interfaces can one class implement? (As
many as needed! We use "
public class class_name implements inf1,
inf2,... {}
")
- What is a stream? What is a byte stream? what is
a character stream? (Byte stream inputs and outputs 8-bit bytes.)
- What types of files does a program will typically
handle? (ASCII text files and binary files)?
- Do you know how to write to a text file? (Use
PrintWriter object, and print() and println()
methods)
- How to append to an existing text file? (Use
"
PrintWriter obj = new PrintWriter (Filename, true);
" to
open)
- How to close a file? Why do we need to do that? (
writer_or_reader_obj.close();
)
- What exception can be thrown during opening a
file to write or read? (
FileNotFoundException
)
- How to read from a text file using Scanner
object? (Use "
Scanner StreamObject =new Scanner(new
FileInputStream(FileName));
" to open a text file to read. )
- What methods can you use to read with a Scanner
object? (
nextInt(), nextDouble(), nextFloat(), nextLine(),
...)
- How to determine the end of a text file using a
Scanner object? (using one of the functions:
hasNextInt(),
hasNextDouble(), hasNextLine()
,...)
- How to read from a text file using a
BufferedReader object? (Use "
BufferedReader readerObject = new
BufferedReader(new FileReader(FileName));
" to open a text file to
read.)
- What methods can you use to read with a
BufferedReader object? (
read()
or readLine()
)
- How to determine the end of a text file using a
BufferedReader object? (using
read()
: if return
-1
; or using readLine()
: if return
null
)
- What is a file path name? When should we
explicitly specify the file path?
- Do not forget to import the proper classes to
your program.
Additional materials:
Lecture slides (polymorphism
pptx) (File_IO
pptx)
lecture examples (ex1.zip,
ex2.zip,
figure_ex.zip)
Spring
break (Mar.16~Mar.21)
Week 9(Review and the second
Mid-term)
Come to the Tuesday (Mar.24) lecture for a review
(review slides pptx,
examples ex1,
ex2,
ex3,
ex4).
Mid-term exam 2
on Mar. 26 at CBB 104 from 9:50am-11:20am! The exam will cover all the
knowledge points after mid-term exam1.
Week 10 (File I/O continued, Exception
Handling)
Main goal: Term project review;
Continue file I/O in java, read/write text files, read/write binary files;
Knowledge points that you should
know:
- What is a stream? What is an input stream and an
output stream?
- Do you know the hierarchies of different stream
classes?
- What is the difference between byte stream and
character stream?
- What is the difference between a binary file and
a text file? How can you tell whether a file is a text file or not?
- How to write to a binary file? (Use
"
ObjectOutputStream outputStreamName = new ObjectOutputStream(new
FileOutputStream(FileName));
" to open a binary file to write)
- What methods can you use to write using a
ObjectOutputStream object? (
writeInt, writeDouble, writeChar,
writeBoolean, writeUTF
, ...)
- How to read from a binary file? (Use
"
ObjectInputStream inStreamName = new ObjectInputStream(new
FileInputStream(FileName));
" to open a binary file to read)
- What methods can you use to read using a
ObjectInputStream object? (
readInt, readDouble, readChar,
readBoolean, readUTF,
...)
- How to determine the end of a binary file? (Use
the "
EOFException
" exception to end a reading loop)
- Do you know the other way to determine the end of
a binary file? (look at the examples provided in the class)
- What is object serialization? Why it is
useful?
- How to achieve object serialization? How to
output and input the serialized objects to and from binary files?
- Do not forget to import the proper classes to
your program.
Term
project rules (Important dates:
deadline for term project proposal 9am April 9, 2015; deadline
for submission of your term project 9am April 23, 2015 before
presentation!!!)
Additional materials:
Lecture slides (File_I/O_2.pptx)
Class examples (binary_file_exs,
object_serialization_exs)
Week 11 (Exception handling, Swing
I)
Main goal: Exception handling in
Java; Understand the mechanism of GUI program, even-driven-programming, and the
basic model of GUI programming using Swing.
Knowledge points that you should
know:
- What is an exception? Why handling them is
important?
- What is the difference between an error and an
exception?
- What is the format of exception handling?
(
try-throw-catch
trio)
- What can be thrown? (Only the objects of certain
exception class)
- Do you know the hierarchy of the exception class?
How to define a new exception class?
- What need to be paid attention to when defining a
new exception class? (must be a derived class of an existing exception
class. typically have at least two constructors. the
getMessage()
method)
- How many exception can each
catch
block catch? (Exactly one)
- If we have multiple
catch
blocks,
what need to be paid attention to? (Their ordering)
- How to handle the exceptions that are thrown
within a method?
- Do you know the two different ways to handle the
exceptions being thrown in a method?
- What is a
throw
clause and when we
need to specify that? (specify in the heading of a method that may throw an
exception)
- What need to be aware of when overriding a method
that throws some exceptions? (We need to keep the list of exceptions in the
throw
clause or at least a subset of it)
- What is a GUI program? Why we need it?
- What is the programming style for GUI programs?
(event-driven: objects/components fire events; the associated listener
objects catch and handle the events.)
- What is the difference between event driven
programming and normal programming? (the order of the flow of the program
is determined by the events not the logics of the algorithms)
- What is the relation between
swing
and awt packages? (Swing
is built on top of awt
but not replace awt. Some classes in awt are useful.)
- What is the basic step of creating a GUI program
using
Swing
? (Create container, set layout manager, add
components, associate listeners (need to customize the event handlers),
launch the interface)
- What is a container? Can you name a few examples
of container object from Swing? (All the classes provided in swing package
are derived from the base class
Container
. So they are
containers themselves.)
- What is the out most container of a GUI program
using swing? (a custermized
JFrame
object)
- What is a component? How is it different from the
container? (Container can host components, components can be put in a
container)
- How to achieve hierarchical interface design?
(Containers inside containers, and so on)
- What is a panel? How to create a panel object?
(using
JPanel
object)
- What are the three layout managers that swing
provides? (
FlowLayout
, BorderLayout
, and
GridLayout
)
Additional materials:
Lecture slides ( Exception_Handling_pptx,
Java Swing I_pptx)
Class examples (exception_handling_exs)
Examples of Java Swing shown in the class are from
textbook
Extra example for the grid layout with borderlines
(.java)
A good place to find other swing example [A java
swing tutorial (http://zetcode.com/tutorials/javaswingtutorial/)]
Week 12 (Java Swing,
continued)
Main goal: continue the
introduction of other standard usage of swing package. If you master the basic
steps of creating a hierarchical GUI program from the previous lectures, the
following will be trivial.
Knowledge points that you should
know:
- What is the default layout manager for a
JFrame
object?
(BorderLayout
)
- What is the default layout manager for a
JPanel
object?
(FlowLayout
)
- What is the general pipeline for implement a GUI program using Java
Swing? (Design the "look" of the interface, implement the "action" of the
interface, show the interface)
- Given a desired interface, do you know how to choose the appropriate
layout manager to achieve the desired layout?
- How to implement the event handler for specific events fired by some
interface objects? (Implement the
ActionListener
interface!)
- Which function in the ActionListerner interface must be implemented?
(
public void actionPerformed(ActionEvent e)
)
- How to distinguish the events fired by different interface objects?
(using the action command string, which can be retrieved using
String
getActionCommand()
function)
- Can you change the action command string for an interface object? How?
(using
setActionCommand(String s)
function)
- How can we add a menu bar to the interface? (using
JMenuBar
class)
- How to create a menu and how to add different choices to the menu? (using
JMenu
class to create a menu object, then create and add
different menu items using JMenuItem
class)
- Do you know how to create nested menu?
- What is a text field and how to insert it to the interface? (using
JTextField
class)
- Do you know how to set the width of the text field?
- What is a text area and how is it different from a text field? (it
enables the input of multiple lines, using
JTextArea
class)
- How to use scroll bar in combination with
JTextArea
objects?
- What is an icon? (a small picture associated with an
ImageIcon
object)
- Do you know how to insert icons to your interface?
- What is a window listener? (an object that can handle window events)
- Do you know how to use window listeners?
Additional materials:
slides (pptx)
Week 13 (Java Interfaces and Inner
Classes)
Main goal: revisit Java interfaces,
get familiar with a number of useful interfaces, learn how to utilize the
mechanism of inner class.
Knowledge points that you should
know:
- What is a java interface? How is it related to java class?
- What is the benefit of using interfaces?
- An interface is NOT a class but is a type.
- An interface can extend (or inherit from) the other interface.
- All the methods in an interface are
public
.
- A class can "implements" one or more interfaces at the same time.
- The class that implements some interfaces will be an abstract class if it
does not provide the function bodies for the methods of those
interfaces.
- An interface cannot have instance variables, but it can have constant
variables.
- Why do we need the
Serializable
interface? How about the
Cloneable
interface?
- What is an inner class and an outer class?
- How many
.class
files will be generated when compiling a
class that contains some inner classes?
- How to access the
public
inner classes?
Additional materials:
slides (pptx)
Student Term Porject
Presentations:
First
place: Group 9-1 (Aaron Johnson) Graph
Second
place: Group 13 (Gjvon Graves, Vicki Lee, Hejal Soni) Graph
Third
place: Group 4 (Darya Balybina, Thomas Doyle) Sudoku
Congratulations!
Week 14 (Term Porject
Presentation)
Final exam will be on
May 14 at CBB 104 from 11:00am-2:00pm! The exam will cover all the material of
Java (NO C++ content).
The following provides an overview of the Java
content we have covered in the class
slides (pptx),
over view examples (.zip)
Links to valuable C++ programming resources:
- C++ .com: A great online reference cite for all of your C++ needs.
- http://www.cppreference.com/wiki/: Another handy C++ reference.
- C++ FAQ: A great source of answers to frequently asked C+ questions
- cppreference.com
- cplusplus.com
- A simple way to start C++: https://developers.google.com/edu/c++/
Links to valuable Java programming
resources:
- Java coding examples (http://www.java-examples.com/)
- A java swing tutorial
(http://zetcode.com/tutorials/javaswingtutorial/)
- painting in java
(http://zetcode.com/tutorials/javaswingtutorial/painting/)
- Using OpenGL with java (http://en.wikipedia.org/wiki/Java_OpenGL;
http://jogamp.org/jogl/www/)