0% found this document useful (0 votes)
248 views4 pages

OOP (Java) Final Exam

This document contains instructions and questions for a final exam on Object Oriented Programming. The exam has four parts - error finding and code correction, essay questions, matching exceptions to cases, and a programming question. The exam tests knowledge of exceptions, access modifiers, abstract classes vs interfaces, and creating a student registration program with exceptions.

Uploaded by

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

OOP (Java) Final Exam

This document contains instructions and questions for a final exam on Object Oriented Programming. The exam has four parts - error finding and code correction, essay questions, matching exceptions to cases, and a programming question. The exam tests knowledge of exceptions, access modifiers, abstract classes vs interfaces, and creating a student registration program with exceptions.

Uploaded by

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

Adama Science and Technology University

School of Electrical Engineering &Computing


Computer Science and Engineering Department
Final-Exam

Course Name: Object Oriented Programing


Course code: - CSE 2202
Date :22,July,2019
Time: 2:30 hours

Name ________________________ Id. No.______________

Department ___________________ Group __________

General Instructions:
✓ write all answers on the attached papers except Part-I

✓ Make sure the exam paper contain four(4) parts and 4 pages including the cover page

✓ Make your answers as neat as possible

✓ Unreadable answer worth nothing

✓ Switch off you mobile phone .

For Instructors

40 %

1
Part I- Error finding and rewrite the corrected code in the box given
1.) Can you identify the error in the below code?(2pts)

interfaceA
{
privateinti;
}

2.) Why the below code is showing compile time error?(3pts)

interfaceX
{
voidmethodX();
void dis();
}

classY implementsX
{
voidmethodX()
{
System.out.println("Method X");
}
}

3.) Does below code compile successfully? If not, why?( 2pt)

interfaceA
{
inti = 111;
}

classB extendsA
{
voidmethodB()
{
i = 222;
}
}

2
Part-II Essay
Instruction : your handwriting should be readable, unreadable answer worth
nothing .
1.) What are the different ways to print exception message on console and
explain each them with examples?( 3pts)
2.) Explain the main difference between throw and throws with examples .( 3pts)
3.) Describe all access modifiers in details within the same package and
different package with examples . (4pts)
4.) Briefly explain the difference between abstract class and interface , support
your answer by example . (3pts)

Part III: Match

select from the given exception type and match with the corresponding case , write
the reason on the attached answer sheet (5%)

A Checked exception
B user defined exception
C unchecked exception
D asynchronous exception

1. A java program that tries to read data from flash, but the flash is not working or
corrupted.
2. A programmer made a mistake during creation of an object using unavailable class.
3. First year ASTU student made a mistake during registration period inserting name in
the filled of date of birth.
4. a given bank system check the current balance before processing withdraw and
transfer fund
5. A java program that tries to access empty array in the java program

3
Part IV- Program Writing

1. write a java program that create a registration of extension students that check either
a student is eligible or not, based on grade 12 result using user defined/custom
exception , if the grade 12 result is <300 it display you are not eligible else registered
student . (5pts)
2. write a java program that read student information from GUI and register students in
the file or in the database and it also display all registered students in the screen/in the
Grid/Jtable
i. Design GUI with the following attributes name ,ID, Gender and
department (3pts)
ii. write data from GUI to file or database (4pts)
iii. read data from file or database and display on the screen or Jtable
(3pts)

You might also like