{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

M257-200806 - M257/E Course Examination 2008*M2570806...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Copyright © 2008 The Open University M257/E *M2570806* Course Examination 2008 Mathematics and Computing: Level 2 M257 Putting Java to work Wednesday 18 June 2008 10.00 am – 1.00 pm Time allowed: 3 hours This examination is in TWO parts and you should attempt BOTH parts. Part 1 carries 50% and Part 2 50% of the total examination score. Part 1 This part contains ten questions. You should attempt ALL the questions in Part 1 . Each question is worth 5 marks and the total score for this section is 50 marks. Write your answers in the answer book(s) provided. Part 2 This part contains three questions. You should attempt TWO questions from Part 2 . Each question carries 25 marks and the total score for this section is 50 marks. At the end of the examination Check that you have written your personal identifier and examination number on each answer book used. Failure to do so will mean that your work cannot be identified. Put all your used answer books and your question paper together with your signed desk record on top. Fix them together with the paper fastener provided.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
M257/E 2 Part 1 Answer all the questions in this part of the paper. Where appropriate you may use diagrams and code examples as well as text. Question 1 Give two examples of existing Java editions. Why are there different editions of Java? [5] Question 2 What do we mean by scope when discussing variables in Java? Provide a skeleton code example with comments to compare the scope of an instance variable with the scope of a local variable. [5] Question 3 Explain the process of garbage collection in Java. You should state: (a) What it means; (b) When it takes place; (c) One reason why it’s useful. [5] Question 4 State three circumstances (as opposed to example uses) in which you might want to use Java's exception handling mechanism rather than providing other code to deal with possible errors. [5] Question 5 A stack is a last-in first-out data structure; that is, items are added to and removed from only the top of the structure. Imagine that we wish to write a class implementing a stack, making use of one of the classes in the Java 5 collections framework. Consider each of the following collection types in turn and give your assessment of its suitability for this purpose, giving a brief justification for your answer in each case. (a) ArrayList (b) TreeMap [5]
Image of page 2
M257/E 3 TURN OVER Question 6 Explain under what circumstances you would want to use each of the following kinds of GUI components. In each case you should also mention a specific scenario in which the component would be appropriate. No code is required. (a) a checkbox (b) radio buttons [5] Question 7 List the steps that you would take when coding an interactive graphical user interface to ensure that clicking an existing button would cause a “hello world” message to be displayed on the screen. No code is required, but you should mention any relevant classes and methods and the order of the steps is important. [5] Question 8 Both the sleep and wait methods move a thread from the Running state to the Blocked state.
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern