HOW DID YOU GET HERE???? This course, for Spring 2007, has been cancelled. Too few students registered.
Added 10.22.2006: I took the exam on July 14 and passed it. I didn't score 100%, which I can hardly believe is possible, but a pass is a pass. You don't normally have to give your score.
Added 6.20.2006: Summary of what happened, to the course and to me.
I had hip replacement surgery on March 31 and April 7. (Long story. Ask me sometime if you're interested.) I was in the hospital for 3+ weeks, which included spring break, so I didn't miss too many classes. I got back to the classroom on May 3. These were mature students, and the subject lent itself to a certain kind of distance learning. The semester ended with an upbeat feel, it seemed to me. We did mock exams corresponding to all of the chapters of the text. With some additional study, at least half the class should be able to pass the Sun Certified Java Programmer exam. Everybody, exam or no, learned a lot about Java. (Including yours truly.)
Added 3.26.2006: Here's an optional programming assignment. The thinking is that I can help you memorize enough stuff about collections to pass the exam, but that's not very satisfying. I am making a totally optional assignment that will let you exercise your knowledge, and cement it some.
I want a file of a thousand random integers in the range of 0 to 9999. Duplicates are not permitted. There are smart ways to do this, and dumb ways. I am specifying a dumb way that lets us practice with collections. (Please don't waste our time showing us that you know a better way. We believe you.) After removing duplicates (or preventing them from being included in your collection), print the numbers in descending order. Use a collection to do this, of course. Oh, and I want to be able to retrieve the thousand numbers in the order in which they were created.
Here is basic code that will do that:
public class Random1 {
Random1() {
for (int i = 0; i < 1000; i++)
System.out.println((int)(Math.random()*10000));
}
public static void main(String[] args) {
new Random1();
}
}
If necessary to convince yourself that this can produce duplicates, change the 10000 to 10.It would be nice to send the output to a file (name of user's choosing). One number per line, with a comma after each number except the last.
Collections issues to consider:
- What collection(s) prohibits duplicates?
- The code above produces ints; how will you proceed if your collection takes only objects?
- What is the fastest (in terms of coding effort) way to sort a collection?
- Do you need an iterator for any of these collections/approaches? What iterators are available?
- Are you absolutely clear on what collections extend something, vs. collections that implement an interface? (You need to be.)
- Distinguish between collection, Collection, and Collections.
- Distinguish between sorted and ordered. Can a collection be ordered but not sorted? Sorted but not ordered?
- Which collections are synchronized? Why is it good for a collection to be synchronized? Under what circumstances is it a disadvantage?
- What other questions should I have asked?
Are we having fun yet? If so, consider making up another exercise like this, as a contribution to the general good. Translation: there is no extra credit for doing any of this. Except, of course, the satisfaction of mastering a subject, and the satisfaction of helping others.
Added 3.26.2006: For another view of the level of difficulty of questions, look at http://www.dickbaldwin.com/java/JavaAP028.htm#3a. These are review questions for the Advanced Placement (high school, obviously) course in Computer Science. But bear in mind Baldwin's goal: "Once you understand everything in this miniseries, plus the material in the lessons that I published earlier on Java Data Structures, you should understand the Java programming features that the College Board considers essential for the first two semesters of object-oriented programming education at the university level." At City College we do not follow an objects-first approach in CS1 or CS2. Whether or not that is a good idea is a debate that has been raging at SIGCSE for ten years that I know of, with no clear winner. Be that as it may, I think you will agree that anybody getting a high score in the AP CS course knows Java at a fairly high level. Humbling.
Added 3.23.2006: Here's the tentative schedule for the rest of the semester, taking into account that that I will have my hip replacement surgery on Friday, March 31. Last night I was thinking April 7, but that wasn't going to work. Too complicated at home, and anyway I want the damned thing fixed.
Monday, March 27: Quiz on Chapter 6: String class, Math class, wrapper classes, using equals(). 15 questions, 30 minutes. Rest of period: start Chapter 7, Overriding hashCode() and equals() only. Please prepare by reading my tutorial, if you haven't: http://ccnyddm.com/JavaBook/EqualsEtc.htm.
Wednesday, March 29: Intensive coverage of the rest of Chapter 7: Collections and Garbage Collection. I wish we had more time on this, but it wasn't meant to be. Observe the type of questions. They want you to know what collection is appropriate in a given situation, and they want to know all the stuff about what's in java.util.Collection and what is somewhere else. Plus: which ones are synchronized, and a few other odds and ends. Some memorization called for. You'll understand it after you've written some programs that use Collections. I had hoped we might do that in this course, but--if you know the lingo of hockey--that one got a hip check. I guess. Not sure we could have done much programming anyway.
Monday, April 3: Quiz on Chapter 7, especially Collections and Garbage Collection, with a sampling of questions from earlier chapters. 21 questions, full period if you want it.
Wednesday, April 5: Individual study (no class). Study on your own, small groups, whatever. If any of you want to meet in the classroom at the normal hour, it's our classroom. Feel free.
Monday, April 10: Midterm. Chapters 1-7, with a generous selection of questions from earlier chapters. No answers provided until after break. 30 or 35 questions, and of course the whole period.
Wednesday, April 12, Monday, April 17, Wednesday, April 19: Have a great Spring Break.
Monday, April 24: Inner classes. We're going to kiss this off with one lecture. You gotta study it on your own anyway.
Wednesday, April 26: quiz on inner classes, start threads.
Monday, May 1: Threads I
Wednesday, May 3: Threads II, as applied to Collections. (I hope.)
Monday, May 8: 30-minute quiz on threads. Start coverage of The Rest of the Story: everything on the 1.4 exam that's not covered in our text, as much as we can do on the 1.5 exam.
Wednesday, May 10: More of the above. Sample questions from the 1.5 exam, maybe.
Monday, May 15: Ditto. But these sessions will be very important if you decide to go for the 1.5 SCJP, an issue that we will discuss. This may be a smart move.
Wednesday, May 17: Ditto, review for final. LAST CLASS.
Final: Whenever scheduled by the Registrar. 60 questions, two hours and twenty minutes (I think).
Added 3.1.2006: I've prepared a table showing for each text chapter, what Sun objectives are covered in that chapter. On weekly quizzes from now on, you are responsible for the material in chapter n, whatever n is, and all previous chapters. But with an emphasis on chapter n, of course. And there will be 12 questions in half an hour, which is 2.5 minutes per question. You get two minutes per question on the real thing.
The schedule of quizzes shown below is still correct. I realize that at one time I estimated a chapter every week and a half, figuring 14 weeks to cover nine chapters. That is now inoperative. The early chapters cover things that are more or less familiar to you, compared with exceptions, inner classes, garbage collection, threads, and collections. And we have to look at the thing new since this edition of the text, like layout managers.
Added 2.27.2006: Check out a new page tentatively called Java Verities: simple things to check quickly on every question on the exam, and either save a simple mistake or wasted time. Please: corrections and additions. And tell me if this is helpful.
Added 2.18.2006: I'm very sorry about the missed classes. I wish it could have been different, but things were out of my control. Here's a sketch of the next few sessions:
Added 2.5.2006: There will be a quiz/exam on the content of Chapter 1 of the text, Language Fundamentals. Major topic headings:
There will be nine of these, one for each chapter, plus a final exam that will be patterned very closely on the Sun exam. As I normally do, in computing your grade I will discard your lowest "quizzam" score. This works out to a quizzam about every week and a half, approximately. Some topics should be mostly familiar to you and will take only a week; others will be almost entirely new. On the latter, we may want to do a programming assignment to put the content into context. And I hope to allow a little time to look into what's new for the Java 5 exam; as of now, this course officially covers the 1.4 exam.
Links:
There are a great many online tutorials and mock exams. We will use some of them in the course. Superb review, course preparation, and certification exam preparation. See Resources.
Added 12.29.2005: A Java 5 edition of the text will allegedly be available Jan 31, 2006. I will believe it when I am holding a bound copy. But if true, and if you want to take the plunge and go for 1.5/5.0 certification, you will definitely want this.
Here's a little quiz to get you in the spirit of the thing.
Answers:
So how did you do?
(This is fun and educational. I'm starting a page of questions and answers.)
Take this course and you will polish off such questions with nonchalance.
Well, maybe not nonchalance, and maybe not all of them, but you will know more about Java than you dreamed it was possible to know.
Why should you care? Two main reasons:
This course is intended to prepare you to pass the SCJP exam, and, since that shouldn't take three credits at the university level, broaden your knowledge of Java to include some design patterns (besides Model/View/Controller), and give you a chance to learn not only the right answers to things like Java collections, but some programming experience to see what they are good for.
Added 2.21.2006: There is a useful table of Modifiers in Java. You need to know this in total detail--although I doubt if memorizing it, without understanding it, would do you much good. I can't make a link to it, for lack of FrontPage server extensions at the site in Germany, but it's http://www.uni-bonn.de/~manfear/javamodifiers.php.
Added 1.1.2006: There's a lot of tutorial material available at www.javabeat.net. (Thanks to David Gurvich.)
Added 1.1.2006: Mock exams are a great way to learn the language. (Being able to pass these--or the SCJP exam, for that matter--does not make you a programmer. But you will have a solid command of the language as you move on to program design, and as you do applications that let you tie the pieces together.) Take the exams, and, where possible, study the answers and their explanations. But don't take any one test too often: your short-term memory will enable you to recognize the question and the answer--without understanding anything. For a list of tutorials, click here and then search on Tutorials. It will be the second hit. While you are there, browse around. A great set of useful facts and links.
Added 12.29.2005. Threads are going to be a major challenge, unless you have taken CSc 332, Operating Systems. And maybe even then, because you've got to know the Java details. I doubt if you can pass the exam section on threads, based only on study of Chapter 9 of the text.
Added 12.21.2005. Here are some useful sites that I have come across in recent days.
Sun certification details. Click here. NOTE: you have to decide which version of Java you want to go for: 1.4, 1.5 (a.k.a. 5.0), and several others. The SCJP (Sun Certified Java Programmer), 1.4 or later, is a prerequisite to all the others. Look into this. There is a lot of difference between 1.4 and 1.5.
Java Programmer Certification Mock Exam No 2, by Marcus Green. Sixty questions in the Sun certification exam style, with immediate answers and explanations. Superb. For another test by the same author, click on JDK1.4 Exam . Different style of questions and grading. We will spend time on these. Or you will, anyway.
A treasure trove of information and links. Amazing. I've seen nothing else quite like it. http://www.wilsonmar.com/1javaref.htm
An extensive glossary of Java and related terms: http://mindprod.com/jgloss/c.html
JavaRanch.com is a great resource. Has a simple mock exam, http://www.javaranch.com/roundup.jsp, that covers much of the simple stuff, and gives you the correct answers when you make a mistake. Lists many other mock exams. Has an annotated book list. The humor is forced phony Western, but don't let that stop you.
The text is Sun Certified Programmer & Developer for Java 2 Study Guide By Kathy Sierra and Bert Bates. These people helped write the exam, so they know what they are talking about. Organized into reasonable chapters, so you aren't skipping around all over (like the ten questions at the start here do). Each chapter has a mock exam on the subject of that chapter, with answers. If you can score 80% or so on those, you can probably pass the exam. With serious effort you ought to be able to get 90%. (But don't take any mock exam too often: you can, without realizing it, memorize the question and the answer--so you get it right without full understanding.) But do take each exam until you can get almost all questions right. Study the answers, whether you were right or wrong. They explain a lot of Java.
Better yet, the CD that comes with the book has mock exams, which mimic the real thing as to content and presentation. We will be doing these a lot, I think.
Warning: this book has a 2002 copyright. We must check the Sun site to see what's being testing now. And there is a little on GUIs: layout manager basics, at least.
Google has changed our world. When you want to know something, Google first, check the index of a book later. For example. This morning I was taking a mock exam, and was asked if a constructor can be inherited. I realized that it was time for me to get a lot of things straight about constructors. So I Googled for Java constructor tutorial. That got me a really good tutorial, with all the good stuff collected in one place and readable. I copied it into Word and highlighted things. For a sample of how useful this tactic can be, I've put it in the site. Click here. And note the list of references at the end, many of which are more tutorials.
Links to tutorials on specific subjects. Many are to the Sun tutorial, which you can download, but not all.
More when I have time and something to say.