Info 2 Proeftentamen 2 - University of Curaao Faculty of...

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

View Full Document Right Arrow Icon
University of Curaçao Faculty of Technical Sciences Information Communication Technology (ICT) Exam : Info 2 (Java) Teacher : D. Hendriks Date : May, 2015 Time : 8.00 – 11.00 Write your name and progress number on all pages. This exam consists of 10 Pages and 4 exercises, including this cover page. Books must be closed . A calculator may be used. Internet may not be used. The answers must be completed on included answer paper In the header of the exercises the maximum number of points is listed in brackets. Total points: 100. Mark = P/10 where P is the total achieved points. Codes of behavior Fraud, no matter in what way, will be punished immediately. Bags must be saved in front of the classroom. Your mobile phone must be switched OFF. Deliver your work (answer form), inclusive your draft. You may keep the exam for yourself. Test Exam Informatics 2 May, 2015 Pagina 1 van 10
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
Exercise 1 Open theory questions (30 points). a) Explain the working of White Box testing. (4) b) A class design requires that a particular member variable must be accessible by any subclasses of this class, but otherwise not by classes which are not members of the same package. What modifier do you need for this variable? (3) c) What is the value of variable output (4) String s = "Our teacher is \"sweet\", don’t you think so?"; String output = s.substring(1, 7) + s.charAt(s.lastIndexOf("i")+2) + s.charAt(11) + s.substring(15, 22) + s.substring(s.length()-2, s.length()); d) What is a checked exception, and what is an unchecked exception? (4) e) Explain how your program may deal with command line arguments. (4) f) Explain how Equivalence partitioning works? When Equivalence partitioning is used? (4) g) What is the output of this program? (3) public class Test{ private static int i = 0; private static int j = 0; public static void main(String[] args){ int i = 2; int k = 3; { int j = 3; System.out.println("i + j is " + i + j); } k = i + j; System.out.println("k is " + k); System.out.println("j is " + j); } } Test Exam Informatics 2 May, 2015 Pagina 2 van 10
Image of page 2
h) public class A { public A() { System.out.println("1 is invoked"); } public A(int a) { System.out.println("2 is invoked"); } } public class B extends A { public B() { System.out.println("3 is invoked"); } } public class C { public static void main(String[] args) { B b = new B(); } } Give the output of execution of class C and explain the output: (4) Test Exam Informatics 2 May, 2015 Pagina 3 van 10
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
Task 2 multiple choice questions: Choose the best answer!
Image of page 4
Image of page 5
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