Question 1:
a) What is the meaning of an object-oriented programming?
b) List eight simple types of data in Java
c) Explain how objects and classes are closely related.
d) Give three characteristics of a class and three characteristics of an object.
e) What is the difference between a compiler and an interpreter?
f) State two differences between a variable and an object.
Question 2:
a) Briefly explain the "Conditional Statement", with an example.
b) Describe what an array is and what is its importance?
c) What is a void method?
d) Briefly describe the difference between "Inheritance" and "Polymorphism".
e) Examine the following program and write down the output.
public class Exam
{ public static void main (String [ ]args )
{ String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
System.out.println (alphabet);
System.out.println ("This string contains" + alphabet.length ( ) + "characters.");
System.out.println ("The character at index 4 is" + alphabet.charAt (4));
System.out.println ("The index of the character Z is" + alphabet.indexOf(‘Z'));
}
}