RU beehive logo ITEC Department logo
ITEC 120
2007spring
ibarland,
jpittges

homeinfoexamslectureslabshws
RecipeLawsliessyntaxjava.lang docsjava.util docs

exam1-study-questions
exam1 study sheet
2007.Spring

Exam1 is scheduled for class on Feb.27 (Tue). The exam will be in-class, on-paper, closed-computer. It will consist of questions very much like these or questions, the quiz1 study questions, and Chapters 1,2 of the textbook. Some of the questions may be directly from these sources.

The single best way to study for the exam is to sit down and re-work homework and lab questions from scratch. The exam will be similar to homework questions and quiz1.

An online help session (using WebCT chat room) will be held Feb.26 (Mon) 20:30 until there are no questions (or 22:00, whichever comes first).

You should know the syntax for declaring classes, writing methods (including constructors), calling methods (including constructors), creating instances (with new), declaring+initializing fields, declaring+initializing local variables, and the difference between fields and local variables. You will need to know the following types: int, double, boolean, String; the keywords void, class, return, if-else, this, new, and the javadoc keywords @return and @param. (And, maybe others I forgot to list here.) You will need to know about Java's arithmetic (precedence of *,/ over +,-, integer division (quotient) vs. floating-point division, remainder (%), and the potential of round-off error). You will need to know the logic operators !, &&, ||.

When giving a java expression or statement, you should be able to type it into BlueJ's Code Panel without any error; this means knowing where you need parentheses, where you need squirly-braces, and where you need semicolons (though I'll give some slack on these). I particularly recommend the problems which require actual code or definitions.

Us vs. the book

There are a few slight differences in material, between the Java code we're using in class, and the textbook:

New phrasing of old explanations

Finally: Concepts we've talked about all semester, but with slightly different phrasing, which might help.

New phrasing of old explanations

Finally: Concepts we've talked about all semester, but with slightly different phrasing, which might help.


1 It immediately raises the question: if both these list classes have exactly the same methods as each other, and always can be interchanged, then why do two such classes even exist? We'll get to that near the end of the semester! The brief answer: depending on the situation, one class sometimes requires less time or memory than the other. For all the programs we'll write in this class, the performance will be the same. We prefer avoiding the name “ArrayList”, because students think it's an array, which it's not -- it's a list!      

2 Or to make the comparison more closely: The function-name is just the label on a box, and you have to specify the type of thing the box stores. In Java, we don't have a way to declare a function-variable without initializing it, and we can't ever get at the function itself without calling it. (For instance, we can't pass Treasure.isBetterThan(Treasure) into a generic sorting-function as an argument.) Other languages (Lisp, Ruby) do allow functions as “first class values”. When we want to get the same effect in Java, we have to use “the command pattern”.)      

3 Or to make the comparison more closely: The function-name is just the label on a box, and you have to specify the type of thing the box stores. In Java, we don't have a way to declare a function-variable without initializing it, and we can't ever get at the function itself without calling it. (For instance, we can't pass Treasure.isBetterThan(Treasure) into a generic sorting-function as an argument.) Other languages (Lisp, Ruby) do allow functions as “first class values”. When we want to get the same effect in Java, we have to use “the command pattern”.)      

homeinfoexamslectureslabshws
RecipeLawsliessyntaxjava.lang docsjava.util docs


©2007, Ian Barland, Radford University
Last modified 2007.Aug.27 (Mon)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme