I had the house to myself yesterday, so I decided to take advantage of the solitude and have a go at the October 2007 past paper for M257. I’ve been doing a bit of light Java practice using the exercises on JavaBat, but apart from that I haven’t done any actual revision for M257 so far; I like to use the first past paper as a kind of diagnostic tool, to highlight which areas I really need to work on, and which I can already handle without doing specific revision.

Part 1 of the paper was fairly straightforward – ten short questions, one about each of the ten compulsory course units, with a mixture of “write some code” and “explain this concept” questions. In this section, it was mainly the latter kind of question that gave me trouble. It looks like I need to do a lot of work on the theory and terminology side of things! In particular, I need to have a better grasp of :

  • the definition of “strongly-typed”
  • the three stages of initialisation that occur when a constructor is executed
  • adapter classes (e.g. MouseAdapter)
  • using the Runnable interface
  • packet switching

I found the longer questions in Part 2 oddly less challenging that the shorter questions; perhaps just because there were more opportunities to write method code, which I’d been practising at all week via JavaBat! Still, there are more than a few areas that I need to improve my understanding of, and I made a lot of silly, basic mistakes. Here’s my list of topics from Part 2 to revise/memorise for next time:

  • Remember to provide the type parameter when creating an Iterator, e.g.:
  • ArrayList<String> list = new ArrayList<String>();
    ...
    Iterator<String> it = list.iterator();
  • Stop getting overloading mixed up with overriding (and I can’t believe I got this wrong again – I can remember getting these mixed up when I was revising for M255!):
    • Overriding – the methods have the same signature
    • Overloading – the methods have different signatures
  • Don’t forget to call next() on a Scanner to move on to the next token, otherwise your while loop will keep going forever!
  • Interfaces – even if a class implements all the methods required for an interface, it still can’t be passed as an argument to a method that was expecting a class that implements the interface; even if all the right methods are there, the class still needs to have implements SomeInterface in its header
  • InputStreams – if you want to wrap an InputStream in a BufferedReader, wrap it in an InputStreamReader first.

And finally, I definitely need to put a lot of work into my understanding of the whole Socket/ServerSocketthing – my answer to the “explain the difference between a ServerSocket and a Socket” bit of Question 13 was just complete BS, I entirely bluffed my way through it! So I’ll probably spend this week making some flashcards for the terminology/concept side of the topic, and putting together some practice programs involving servers and clients, and hopefully that’ll help firm up my grasp of it!

Advertisements