0% found this document useful (0 votes)
4 views3 pages

2013 Test 1

This document appears to be an exam for an Object Oriented Programming course. It tests knowledge of OOP concepts like inheritance, polymorphism, encapsulation. It contains multiple choice and true/false questions about Java features like access modifiers, variable naming, constructors. It also contains short programming problems to write and test code.

Uploaded by

eyuel haile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

2013 Test 1

This document appears to be an exam for an Object Oriented Programming course. It tests knowledge of OOP concepts like inheritance, polymorphism, encapsulation. It contains multiple choice and true/false questions about Java features like access modifiers, variable naming, constructors. It also contains short programming problems to write and test code.

Uploaded by

eyuel haile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Wollo University /KIOT

College of Informatics
Object Oriented programming Test I
Date: 05-10-2023
Time Allowed: 1’:30’’.
Name: _____________________________________ ID No: ______________________

PART I Choose the best answer (1.5 each)


1. Which of the following is NOT an object-oriented programming principle?
A. Polymorphism C. Encapsulation
B. Inheritance D. Procedure
2. Which of the following is NOT an access modifier in Java?
A. Private B. internal C. protected D. static
3. What is polymorphism in Java?
A. The ability of a class to inherit from multiple superclasses
B. The ability of a method to have different implementations depending on the
type and number of parameters.
C. The ability of a class to create multiple instances of itself
D. The ability of a method to call other methods in the same class
4. Which of the following is NOT a Java data type?
A. Int B. double C. final D. boolean
5. What is the Java keyword used to create a new object?
A. New B. create C. instance D. make
6. What is a constructor in Java?
A. A special method used to create objects
B. A method that is called when an object is destroyed
C. A variable used to store numerical values
D. An interface used to communicate with other programs
7. What is inheritance in Java?
A. A way to create objects
B. A way to access private variables
C. A way to reuse code from a parent class
D. A way to declare constants
8. Which of the following access modifiers can be accessed only inside the class
A. Private B. Public C. Protected D. Internal

9. Which one of the following is not the correct Variable Naming?


A. $salary B. _salary C. &salary D. salary

10____________ is a key feature of java technology responsible for freeing any


memory that can be freed.

A. Code Security C. Java Virtual Machine (JVM)


B. Garbage Collection thread D. Bytecode

PART II Write the output of the following programs in the provided box

1.

2.
3.
4. Given (4 pts)

Based on the above code fill the following table


Note that:- Write the variable name based on variable type, method name and
class name

Local Variable Instance Class/Static Methods Name Class Name


Variable variable

5. create a class named students with name, age, sex attributes/variables and
info() method for displaying the student all information.(2 pts)

You might also like