Warning: Undefined array key 1 in /home/acaproso/public_html/._System/._Template/.Main.php on line 116
Object oriented concepts questions.

Object oriented concepts questions.

Find Object oriented concepts university examination questions in acaproso.com

# Question
1

State whether each of the following statements is true or false

  1. A subclass typically encapsulates less functionality than does its superclass.
  2. A superclass typically represents a larger number of objects than its subclass represents.
  3. The default case is required in the switch selection structure.
  4. The break statement is required in the default case of a switch selection structure.
  5. The expression(x>y && a is true if either x>y is true or a is true.
  6. The expression containing the || operator is true if either or both of its operands is true.

Short answers
2

What is the output of the following code assume grade is neither A nor B nor C
Switch(grade){
case`A`:
System.out.println("Great Job!");
break;

case`B`:
System.out.println("Good Job!");
break;

case`C`:
System.out.println("You can do better!");
break;
default:
System.out.println("Consider cheating!");
}


Short answers
3

Design a Java class named UniversityCircle with two methods that compute and display an area and circumference of a circle.


Practical
4

With examples describe the following terms

  1. Object oriented programming
  2. Dynamic binding
  3. Abstraction

Short answers
5

Differentiate the following terms

  • Overloading and overriding
  • this and super keywords in java

Short answers
6

Very briefly explain the following 

  1. Class and Object
  2. Constructors and their types

Short answers
7

Consider a class Person that consists of instance variables- name, age and gender. Instance methods - setName, getName and getAge. Class method- getAverageAge.

  1. Graphically represent this calss using UML notation
  2. Write a constructor that initialize all instance variables
  3. Using Java language , create an object whose initial values for name, age and gender are Juma, 28 and Male respectively.

Short answers
8
  • What is use case diagram?
  • Briefly describe the aim of inclusion and extension in the use case diagram.

Short answers
9

Describe the messages and methods in OOP.


Short answers
10

Consider the following scenarios the outline the objects ( at most three) and their interactions in terms of messages ( at least two)  and arguments

  • A passenger buying a bus ticket
  • A student borrowing a book in library
  • A lecturer deliverign his/her lecture to a class of students

Differentiate the sequence and collaboration diagram. Draw the sequence and collaboration diagrams that represents the scenario above.


Short answers