четверг, 25 февраля 2016 г.

COMP 274 Midterm Exam


Question 1: What is the difference between overloading and overriding? (8 points)
Question 2: What is the difference between abstract class and interface? (10 points)
Question 3: What is up-casting and down-casting?
Assume the base class has methods A() and B(), and the sub class has methods C() and D(). When up-casting is used, can the reference access the methods in the subclass?
Question 4: What is the result of the code segments below?
Question 5: What is the result of the code segments below?
Question 6: Please print out the value of a, b, i, j (8 points)
Question 7: (18 points)
What is constructor?
Question 8: You are given an integer array, please find how many 0 in the array. For instance, in the array {1, 2, 4, 0, 3, 0, 5}, there are 2 '0's. (8 points)
Question 9: (12 points)
Assume you are given a string below, determine the output of the following statements

Комментариев нет:

Отправить комментарий