| Computer Laboratory Course material 2009–10 |
Further Java
|
![]() | ![]() |
| Andrew Rice | Alastair Beresford |
Students must pass five "ticklets" (1-5 inclusive) in order to gain the overall tick for this course. Work completed for Tick 0 is marked separately and is also worth a tick.
Students are expected to attend one practical session per week. The dates and times of the practical sessions associated with this course are as follows:
| Date | Time | Session |
|---|---|---|
| Monday 2nd November | 2pm — 4pm | A & B |
| 4pm — 6pm | C & D | |
| Monday 9th November | 2pm — 4pm | A & B |
| 4pm — 6pm | C & D | |
| Monday 16th November | 2pm — 4pm | A & B |
| 4pm — 6pm | C & D | |
| Monday 23rd November | 2pm — 4pm | A & B |
| 4pm — 6pm | C & D | |
| Monday 30th November | 2pm — 4pm | A & B |
| 4pm — 6pm | C & D |
The workbook for each practical class will appear here just prior to the start of the practical session.
The printed workbooks contain (at the very least!) the following errors. Errors are indexed by workbook (W), page (P) and line (L), which may be negative, indicating that the reader should count upwards from the bottom of the page. These errors have been corrected in the on-line versions of the workbooks shown above. If you find any further errors, please email ticks1b-admin[at]cl.cam.ac.uk.
| W | P | L | Errata | Corrige | From |
|---|---|---|---|---|---|
| 1 | 3 | 12 | create a class in the project called HelloWorld | create a class called HelloWorld in the package you've just created | rhm31 |
| 1 | 7 | 20 | } | }; | ia264 |
| 1 | 8 | 3 | uk.ac.cam.crsid.tick1 | uk.ac.cam.crsid.fjava.tick1 | arb33 |
| 1* | 1 | 13 | Swing | AWT | rjw201 |
| 2 | 2 | 26 | heirarchy | hierarchy | db434 |
| 2 | 3 | 14-15 | http://www.cl.cam.ac.uk/teaching/0910/fjava/testmessage.jobj | http://www.cl.cam.ac.uk/teaching/0910/FJava/testmessage-crsid.jobj | acr31 |
| 2 | 4 | -9 | http://www.cl.cam.ac.uk/teaching/0910/fjava/messages.jar | http://www.cl.cam.ac.uk/teaching/0910/FJava/messages.jar | acr31 |
| 2 | 5 | 2 | on port 15003 | on port 15003. | arb33 |
| 2 | 6 | -3 | deserialised | deserialise | db434 |
| 2 | 7 | 7 | loaded | loaded. | acr31 |
| 2 | 7 | 7,11 | [Server] | [Client] | acr31 |
| 2 | 8 | 5-6 | Remove the two print statements you placed in the code in response to questions 11 and 12. (Only remove the print statements, leave the rest of the code intact.) | Remove the print statement you placed in the code in response to question 12. | acr31 |
| 2 | 8 | 10 | [Server] | [Client] | acr31 |
| 2 | 8 | 14 | Please make sure you print out the contents of any fields (question 15 above) before you invoke the run method (if any). | acr31 | |
| 2* | 1 | -12 | Extra hint added for Apple users | mcm57 | |
| 3 | 1 | 14 | coordiation | coordination | jrb95 |
| 3 | 1 | 14 | nor was there | nor were there | jrb95 |
| 3 | 6 | -7 | cycle 0 | cycle 1 | jrb95 |
| 3 | 7 | 14-16 | aquire | acquire | jrb95 |
| 3 | 7 | 20-23 | aquiring | acquiring | jrb95 |
| 3 | 7 | 20-23 | aquiring | acquiring | jrb95 |
| 3 | 7 | -5 | BankSimlator | BankSimulator | jrb95 |
| 3 | 7 | -3 | acounts | accounts | jrb95 |
| 4 | 4 | 20 | excuted | executed | jrb95 |
| 4 | 4 | 21-26 | Steps 3 and 4 are the wrong way round. | Perform step 4 before step 3. | acr31 |
| 4 | 6 | 16-17 | MultiMessageQueue | MultiQueue | acr31 |
| 4* | 1 | -6 | java -jar chatserver.jar 2222 localhost:5678 | java -jar chatserver.jar 2222 1111 localhost:5678 | rk395 |
| 4* | 1 | -4 | java -jar chatclient.jar 1234 | java -jar chatclient.jar localhost 1234 | rk395 |
| 4* | 1 | -3 | java -jar chatclient.jar 2222 | java -jar chatclient.jar localhost 2222 | rk395 |
| 5 | 2 | -13 | MESSAGES | messages | rc478 |
| 5 | 3 | -16 | top ten most recent posts made by users. | top ten most recent posts made by users, latest first. | jrb95 |
| 5 | 4 | 12 | shutdown the database cleanly | close open connections | arb33 |
| 5 | 4 | -7 | Total messages | Total logins | arb33 |
| 5 | 4 | -3 | Databse | Database | jrb95 |
| 5 | 5 | 14 | you should also create the database tables. | arb33 | |
| 5 | 5 | 15 | shutdown the database and | arb33 | |
| 5 | 5 | -5 | StatusMessage | RelayMessage | arb33 |
| 5 | 6 | 1 | RelayMessage | ChatMessage | arb33 |
There is an error in the use of database connections and calls to commit in Workbook 5. Since the class Database only creates a single connection to the database, and calls to commit are made on this single connection, different threads may still interleave updates to the statistics table and the messages table. One easy fix is to create a new instance of Database for each instance of ClientHandler, however this might lead to performance problems when a large number of clients are connected. A better solution would associate a database connection with each instance of ClientHandler. You do not need to implement either fix to pass Ticklet 5 this year.
Students have been assigned the following seats for the practical classes. Please email the Principal Lecturers without delay if you are a CST 1B student and your name is not in this list.
| Student | CRSID | Session | Machine |
|---|---|---|---|
| Aggarwal, I. | ia264 | C | PCCL036 |
| Alexander, T. | ta299 | D | PCCL054 |
| Aralbayev, A. | aa537 | D | PCCL060 |
| Askham, H. | ha293 | C | PCCL045 |
| Aucinas, A. | aa535 | B | PCCL023 |
| Bastow, J. | jb637 | D | PCCL059 |
| Bell, J.R. | jrb95 | D | PCCL061 |
| Benwell, J.D. | jdb65 | D | PCCL069 |
| Betser, D. | dmb62 | A | PCCL006 |
| Blume, B. | bb379 | A | PCCL003 |
| Bown, J.C. | jcb84 | D | PCCL065 |
| Brewin, F.P. | fpb22 | A | PCCL004 |
| Brown, C.L. | clb76 | B | PCCL039 |
| Cameron, H.D. | hdc21 | C | PCCL048 |
| Chen, N.J. | nc344 | C | PCCL039 |
| Chen, Q. | qc217 | B | PCCL034 |
| Chick, O. | oc243 | D | PCCL057 |
| Clark, M.J.A. | mjac4 | B | PCCL027 |
| Codreanu, R. | rc478 | B | PCCL021 |
| Cooper, R. | rmc57 | A | PCCL019 |
| Dalibard, V. | vd241 | B | PCCL037 |
| Drozdzynski, M. | md481 | B | PCCL026 |
| Dunietz, J. | jd511 | B | PCCL046 |
| Eaton-Rosen, S. | se289 | C | PCCL035 |
| Edwards, T.D. | tde21 | D | PCCL070 |
| Eide, S.P. | spe24 | C | PCCL049 |
| Griffiths, L.J. | ljg39 | B | PCCL035 |
| Hall, S. | sh580 | B | PCCL043 |
| Hamad, H. | hh316 | C | PCCL051 |
| Hands, C.R. | crh55 | B | PCCL040 |
| Helliwell, G. | gh323 | B | PCCL024 |
| Hogan, M.W. | mwh27 | A | PCCL020 |
| Hollington, S. | sh583 | B | PCCL031 |
| Hughes, H. | hrh32 | A | PCCL015 |
| Imbrasaite, V. | vi206 | B | PCCL041 |
| Iosif, A. | ali22 | C | PCCL043 |
| Irons, D. | di227 | B | PCCL028 |
| Jiang, X. | xj216 | A | PCCL008 |
| Johnston, C. | crj29 | D | PCCL056 |
| Joseph, I. C. | icj20 | A | PCCL045 |
| Kaplan, J. | jk451 | C | PCCL037 |
| Karim, R. | rk395 | C | PCCL042 |
| Katz, E.P. | epk23 | D | PCCL071 |
| Kim, J.M.C. | jmck3 | D | PCCL058 |
| Kislov, D. | dk382 | D | PCCL068 |
| Kyng, R.J. | rjk43 | C | PCCL038 |
| Lehtinen, M.K. | mkl25 | A | PCCL016 |
| Li, R. | rl374 | D | PCCL063 |
| Maas, M.C. | mcm57 | C | PCCL041 |
| McKnight, A. | am771 | A | PCCL001 |
| Milouchev, A. | am925 | C | PCCL034 |
| Mohrmann, J.K. | jkm47 | D | PCCL064 |
| Montgomery, D.J. | djm208 | A | PCCL013 |
| Moody, D. | dm484 | A | PCCL012 |
| Nath, P.A. | pan23 | A | PCCL005 |
| Nawazish, A.M. | amn36 | D | PCCL062 |
| Neve, J. | jn283 | B | PCCL029 |
| Pham, N.L. | nlp27 | C | PCCL053 |
| Piggott, D.H. | dhp26 | A | PCCL018 |
| Powell, C. | cp398 | A | PCCL010 |
| Qin, T.T. | ttq20 | D | PCCL067 |
| Reid, D. | dr336 | B | PCCL030 |
| Reynolds, P.J.R. | pjrr2 | B | PCCL032 |
| Schmidt, L. | ls475 | B | PCCL038 |
| Sethasathien, N. | ns450 | B | PCCL042 |
| Shan, Y. | ys333 | D | PCCL066 |
| Shaw, S. | ss837 | B | PCCL033 |
| Spencer, C. | cs560 | D | PCCL055 |
| Sumner, P. | ps488 | C | PCCL046 |
| Szpiro, N. | ns447 | C | PCCL052 |
| Thomas, D. | drt24 | A | PCCL007 |
| Tordoff, S.S. | sst32 | B | PCCL025 |
| Vaitukaitis, V. | vv236 | C | PCCL040 |
| van Duuren, K. | kv250 | C | PCCL044 |
| Walshaw, C. | clw60 | A | PCCL014 |
| White, T. | tfmw2 | B | PCCL022 |
| Whitehouse, R.J. | rjw201 | A | PCCL011 |
| Whittaker, S.R. | srw42 | A | PCCL017 |
| Wilson-Haffenden, S.R. | srw45 | A | PCCL050 |
| Wright, D.A. | daw68 | C | PCCL047 |
| Zhang, F. | fz227 | A | PCCL002 |