-
(a)(i)Define Object Oriented Programming (OOP). [2 marks]
(ii)Juxtapose between OOP and Procedural Programming. [4 marks]
(b)Java is an OOP language. Specify the Java syntax for class definition and give an example of it. [3 marks]
(c)Assuming there is a Java class called Rectangle that models the shape rectangle, define this class with suitable attributes and methods of your choice. [3 marks]
-
(a)Enumerate the principles of OOP and write short notes on each of them. [4 marks]
(b)(i)What is a constructor? [3 marks]
(ii)What is/are the functions of constructors in Java? [2 marks]
-
(a)(i)What is an object? [2 marks]
(ii)State how objects are created in Java. [2 marks]
(b)With the aid of examples, describe the following programming constructs: (i) Expression [2.5 marks] (ii) Statement [2.5 marks]
-
(a)Describe the following in Java: (i) Data types (ii) Variable (iii) Literal (iv) Identifier [4 marks]
(b)For a Java program to be executable, the main method must be defined. State the format of the main method and what each part implies. [5 marks]
