Introductory to object-oriented programmin UE Past Papers Questions.


View All Courses

(4378) Question Category: Short answers

Define the following terms

  1. Static Method
  2. Final class
  3. Super class
  4. Java Package
  5. Abstract Method
  6. Protected Access Modifier

Answer / Solution

UNSOLVED

(4379) Question Category: Short answers

Mention and explain the four principles of Object Oriented Programming.

Answer / Solution

UNSOLVED

(4380) Question Category: Short answers

Distinguish between method overloading and method overriding.

Answer / Solution

UNSOLVED

(4381) Question Category: Practical

Write a simple java method that can add 3 numbers and return their summation.

Hints:

  1. use three parameters x,y and z
  2. assume x,y and z can have decimal values
  3. method name should be Adder
  4. the method should be static

 

Answer / Solution

UNSOLVED

(4382) Question Category: Practical

Write a Java program to show an example of how a “Student” class can inherit “Person” class.

Hints:

  1. Class Person has the following states and behaviors;

States: String name; string id; char sex; int age;

Behaviors: readBook() and writeBook()// should be abstract.

  1. In the parent class write at least one constructor with any number of parameters of your choice according to the above states.
  2. Overload the above constructor with another making sure that you follow the standard rules for overloading   
  3. The main method should be implemented in a child//sub class
  4. In the sub-class implement method overriding by implementing readBook() and writeBook() with a body of your choice.

Answer / Solution

UNSOLVED


View All Courses
News & Updates | Recently
Recent Updates
questions

2024-05-02: questions

Questions Uploaded on 2024-05-02


questions

2024-03-29: questions

Questions Uploaded on 2024-03-29


questions

2024-03-19: questions

Questions Uploaded on 2024-03-19

Dismissible in 10 seconds