CMSC 331
FAQ page
Sections 0201
CMSC 331
Section 0101
Spring 200
Q: What will be on the quiz
Tuesday 4/8?
A: As with all earlier quizzes it
will be cumulative. Study previous quizzes. Also be prepared to answer questions
of the form what is in the first set of this or what is in the follow set of
that. Only multiple choice
questions will be on the quiz. The
material from the advanced Java section will include questions on
serialization, reflection and networking with sockets. There will also be 3 or
so ML questions. There will be 20-25 questions in total.
CMSC 331 Section
0201
Spring 2006
Q: I missed class on Monday
4/10, were there any announcements?
A: Yes. There is no class on
w\Wed 4/12 and Wed 4/19. The P2 project may be turned in on Mon 4/17. The Quiz
will be on 4/24.
Q: I get a lot of messages of
the form : expected a Number given a T – is there a
way around this?
A: Yes, declare the object to
be of class Number, you may find that you need this for the HashMap
approach I showed you in class.
Q: To take the derivative you
have to multiply the exponent (an Integer) by a coefficient (a Number), how can
this be done?
A: The Number interface may be
extended to include a method Number multByInteger(Integer exp) that does the right thing for each class that
implements the Number interface.
----------------------------------------------------------------------------------------------------
CMSC 331 Sections 0101 and 0201
Spring 2005
Q: Are the answers for Q2
posted?
A: Yes, right
here.
Q: Is there any chance that
the due date for P2 will be moved?
A: It will be moved
back 1 class. Those handing it in by the deadline will receive a 5 point bonus.
Q: When is the final?
A: It’s on 24 May
if you are in the Tues section otherwise the 25 May. Either way its in the same room as our class.
Q: Can I take the final on
the other section’s day?
A: Yes probably.
Send me email and tell me why you need to switch and wait for approval. If you
don’t hear from me don’t assume that request was approved.
Q: Is the final cumulative?
A: Yeah verily.
Q: What is P2 going to be
about, and when will it be handed out?
A: It will be a
Java assignment involving Threads, Sockets and Reflection and will be posted
the week of 4/11 and due 2 weeks latter or so.
Q: When is Q2 going to be and
what will cover?
A: It will be on Monday
4/45 or Tues 4/26 depending on the section. It will cover all material since
the midterm.
Q: Where can I find the
midterm?
A: It’s online
here: http://userageps.umbc.edu/~vick/331/assignments/Spring05/Tests/MT/MT.htm
Q: Is there a new due date
for Project 1?
A: Yes, it will be
due on Wed 3/30 for the MW section and Thurs 3/31 for the TTh section.
Q: I am using a HashMap to store the variable value binding resulting from
assignments. Everything works fine when I put the variable/value pair in the
table with the put method but I get a runtime type exception when I try to pull
the value out with the get method. What is the cause of this?
A: Regard the
signatures below:
Object HashMap.put(Object
key, Object value) and
Object HashMap(Object key);
Suppose that we have
String variable = “a” ; // from a= 12.34
String value = “12.34”
HashMap bindings = new HashMap(); // map for
variable/value bings
bindings.put(vaiable,value); //binds the
value 12.34 to variable a
To get the value for a variable we would do
Value = (String) bindings.get(“a”);
Note that we must do the cast (String) because the
return type of get is Object but the left hand side is a String. For the types
on each side to agree we must use a cast.
Q: What classes and methods
are most useful for making tokens?
A: The Pattern,
Matcher and String classes might be useful as shown below. See the Java tutorial
section on REGEX for details.
|
class |
method |
|
compile |
|
|
matcher |
|
|
matches/find |
|
|
start |
|
|
end |
|
|
group |
|
|
substring |
|
|
trim |
Q: Will the weather delay
push back the due date of Program 1?
A: Yes by at least
one week.
Q: Is there an error in the
grammar for Program 1.
A: Yes consult the
page for Program 1 and look for the red type. Note also some tips have been
added to the bottom. Mostly stuff discussed in class.
Q: How do I do i/o for Program 1?
A: All output is
dine with System.out, all input comes from standard
in as the code below illustrates
import jav.io.*;
BufferedReader in = new BufferedReader( new InputStreamReader( System.in));
String aLine = in.readLine();
Q:Why isn’t <g> -> {a} b {b} the same as <g> -> a <g> b | b
A: Think of it
like this. The first is a sequence of a’s, followed by a single
b and then a sequence of b’s. There is no reason to
assume that the sequence of b’s is exactly the same
length as the starting sequence of a’s. In the later
grammar we’re assured that this is the case because at each (recursive) step we
add an a to the left and a b on the right so that the
sequence on each side of the b is exactly the same length.
Q: When is the final?
A: See
http://www.umbc.edu/academics/acadcalsp05.html
Q:When is the next quiz?
A: I’ll tell you with
at least one week notice? It a very good idea to keep up with the material as we go.
Q:What should I do if I miss
class?
A: The first thing
to do is to ask a colleague in the class what you missed and ask to borrow
their notes. The second thing to do is ask me.
Please be sure that you have asked your colleague first. There are
roughly 65 students in each section
Q When you hand out the
programming assignment will it always pertain to material we’ve covered completely.
A: No I may hand
out or post the assignment concurrently.
Q: Can I use another edition of the book?
A: It is not recommended, but the 5th
edition has much of the same material. Be forewarned. I will not entertain
questions like “where is that material in the nth edition?”
Q: What is a shibby anyways?
A: Chosen from many entries of the
newurbandictionary.com) shibby means:
shibby
a fill in the blank word, used for just
about anything