0% found this document useful (0 votes)
1K views

Computer Programming 2 Final Lab Exam Answer

The document discusses a computer programming exam containing 5 multiple choice questions about Object Oriented Programming concepts like exceptions, finally blocks, inheritance, polymorphism and abstract classes.

Uploaded by

Kenneth Maylos
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)
1K views

Computer Programming 2 Final Lab Exam Answer

The document discusses a computer programming exam containing 5 multiple choice questions about Object Oriented Programming concepts like exceptions, finally blocks, inheritance, polymorphism and abstract classes.

Uploaded by

Kenneth Maylos
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/ 4

UGRD-ITE6104 Computer Programming 2

Started on Thursday, 17 August 2023, 9:30 PM


State Finished
Completed on Thursday, 17 August 2023, 9:31 PM
Time taken 1 min
Marks 5.00/5.00
Grade 100.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00

Flag question
Question text
What do you called a problem that arises during the execution of a program?
exception
Answer:
Question 2
Correct
Mark 1.00 out of 1.00

Flag question
Question text
Finally block defines following a try block or a catch block?
Select one:
True
False
Question 3
Correct
Mark 1.00 out of 1.00

Flag question
Question text
What is the short Object-Oriented Programming?
OOP
Answer:
Question 4
Correct
Mark 1.00 out of 1.00

Flag question
Question text
class Mathematics {
public void math() {
System.out.println("Mathematics Symbol");
}
}

class Add extends Mathematics {


public void ____() {
System.out.println("ADD: + ");
}
}

class Subtract extends Mathematics {


public void ____() {
System.out.println("SUBTRACT: - ");
}
}

class Main {
public static void main(String[] args) {
Mathematics myMath = new Mathematics(); // Create a Animal object
Mathematics myAdd = new Add(); // Create a Pig object
Mathematics mySubtract = new Subtract(); // Create a Dog object
myMath.____();
myAdd.____();
mySubtract.____();
}
}

What is the answer for the blanks?


math
Answer:
Question 5
Correct
Mark 1.00 out of 1.00

Flag question
Question text
Match the following:

Inheritance Class Hierarchy


Answer 1

Polymorphism Class Hierarchy


Answer 2

Abstract Class Hierarchy


Answer 3
Feedback
Your answer is correct.
Inheritance Class Hierarchy

Polymorphism Class Hierarchy

Abstract Class Hierarchy

You might also like