This preview shows page 1 - 2 out of 2 pages.

KENYA METHODIST UNIVERSITY END OF 3 RD TRIMESTER 2016 (SB) EXAMINATION SCHOOL : SCIENCE AND TECHNOLOGY DEPARTMENT : COMPUTING AND INFORMATION SCIENCE UNIT CODE : CISY 210/BBIT 223/DCIS 210 UNIT TITLE : OBJECT ORIENTED PROGRAMMING TIME : 2 HOURS INSTRUCTIONS Answer question one in section A and any other two in section B Section A Question One (30 MARKS) a) Describe the three pillars of OOP (6 Marks) b) Distinguish between a method and constructor (4 Marks) c) Describe three access control specifiers in java (6 Marks) d) What is the importance of abstract classes (2 Marks) e) List three types of exceptions that can occur in java a program(3 Marks) f) Write four java statements that each add 1 to an integer variable x (4 Marks) g) Using the scanner object, write a java program to get input from a dialog box (5 Marks) Section B Question Two (15 Marks) a) Describe two methods of creating threads in java program
Image of page 1

Subscribe to view the full document.

Image of page 2

Unformatted text preview: (4 Marks) Page 1 of 2 b) Distinguish between method overriding and method overloading(4 Marks) c) Write a Java program that sorts in ascending order an array of ten integer values (7 Marks) Question Three (15 Marks) a) Consider a java program that uses a super class called shape to declare three subclasses rectangle, square and cube. Using this scenario; a. Write a java program code to illustrate inheritance (7 Marks) b. Write a program code to illustrate the concepts of polymorphism (8 Marks) Question Four (15 Marks) a) Using a recursive function, write a program in java that will compute a factorial of a number (7 Marks) b) Give the syntax of the following control structures (6 Marks) a. Do while b. Switch Statement c. For loop c) What is a package? what is its importance in Java (2 Marks) Page 2 of 2...
View Full Document

  • Winter '15
  • Joyce Wambugu

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

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes