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

Briefly explain the following terms as applied in object oriented programming.

  1. A Class
  2. An Object

Long answers
2

With examples ( if any ) describe the following terms

  • Data abstraction
  • Polymorphism
  • Modularity
  • ``is a`` relationship

Short answers
3

Briefly differentiate the following terms

  • Methods and messages
  • Procedural programming and object - oriented programming
  • Class and objects
  • Dynamic binding and static binding

Short answers
4

Consider a student registration program used by the registrar`s office. The program keeps track of students who are registered for a given semester. For each student registered, the program maintains the student`s name, address, phone number, the number of subject in which the student is enrolled and total credit hours. The program also keeps track of the total number of registered students.

  • With reasons identify instances and class variables of a student class that is suitable for this program.
  • Propose any three methods in the student class above.
  • Implement above student class using Java.

Short answers
5

Consider the following scenarios and outline the objects ( at most three objects) and their interactions in terms of massages and arguments:

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

Short answers
6

Explain the following terms and statement in briefy as used in object oriented programming

  1. Concept of inheritance
  2. Encapsulation
  3. Relationship between superclass and subclass in the concept of inheritance
  4. Overriding superclass methods

Short answers
7

Compile this code and correct if there is any error and state what will be its output.
public class Event{
private int eventGuests;
public void printEventGuests(){
System.out.println(``Event guests:``+eventGuest);
}
}

public class Jaribu{
public static void main(String[] args){
Event hawa = new Event();
hawa.printDinnerChoice();
}
}
public class DinnerEvent extends Event{
public void printDinnerChoice()
{
if(dinnerChoice=='b')
System.out.println("Dinner choice is beef");
else
System.out.println("Dinner choice is chicken")
}
}


Short answers
8

What is a constructor in java programming ?

 


Short answers
9

What is the output of the following code ?
public class Test{
public static void main(String[] args){
Wende child = new Wende();
child.chuo
}
}
public class Juni{
public udsm()
{
System.out.println("He study at University of Dar es salaam");
}
}
public class Wende extends Juni{
public chuo()

Short answers

10

Explain each of the following terms in briefy
-Polymophism
-Method Overloading
-Instance variable


Short answers