Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please read all instructions (including these) carefully. You should look throug

ID: 3695486 • Letter: P

Question

Please read all instructions (including these) carefully. You should look through the entire exam before getting started, in order to plan your strategy. You have 50 minutes to complete the exam. This exam is closed books and closed notes. Please write your solutions in the spaces provided on the exam. Make sure your solutions are neat and clearly marked. You may use the backs of the exam pages as scratch paper. In accordance with both the letter and spirit of the Honor Code, I have neither given nor received assistance on the exam. NAME:_____________.__________ Signature:________ (Print) Last First A way to discover which of two classes is the base Class and which is the subclass is to___________ look at the class size Try saying the two class names together Use polymorphism Both a and b are correct Which of the following choices is the best example of a parent Cass relationship? RoseFlower Present/Gift Dog/Poodie Sparrow/Bird The java keyword that creates inheritance is_______ static enlarge extends inherits Abstract classes differ from other Casses in that you_________. must not code any methods within them must instantiate objects from them cannot instantiate objects from them cannot have data fields within them Abstract Classes can contain__________. abstract methods nonabstract methods both of the above none of the above When you create a______ in Java, you create a variable name in which you can hold the memory address of an object. field pointer recommendation reference In object-oriented programming terminology, an unexpected or error condition a(n)_______________. anomaly aberration deviation exception In object-oriented terminology, you____________ a procedure that might not complete correctly. try catch handle encapsulate A collection of data stored on a nonvolatile device in a computer system is_________. a file an application volatile a type of binary file A complete list of the disk plus the hierarchy of directions in which a file resides is its__________. directory folder delimeter path Define the following key Terms_________ is a mechanism that enables one class to inherit or assume both the behavior and the attributes of another class._________ is the technique of using the same method to indicate different Implementations.________ contain data that can be read in a text editor because the data has beeen encoded using a scheme such as ASCII or Unicode. A__________block is a segment of code that can handle an exception that might be thrown by the try lock that precedees it.

Explanation / Answer

I.

1. B)
explanation: Inheritance is a way to discover which class is base and which

class is derived based on the keyword.
-> for example in java extends keyword used to identify which class is base

and which class is derived based upon the usage i.e class name before

extends keyword is derived and class name after extends keyword is base

class.
-> based upon size of class,can't decide a class is base or derived.
-> polymorphism is the mechanism to implement same method by varying

different datamembers and functionality.so it is also can't decide a class

is base or derived.
-> two class names together in inheritence using extends keyword.so option

B) is correct.
2. C)
explanation: Dog poodle is the best parent class relationship.
3. C)
explanation: In java extends keyword used to implement Inheritance

mechanism.
4 A)
explanation: Abstract class cannot implement all it's methods then it looks

different to other classes.
5. C)
explanation: Abstract class can or cannot has abstract methods.
6 D)
explanation: In java, a reference is the holding memory of variable through object.
7 D)
explanation: Exception is defined as unexpected error.
8 B)
explanation: catch block might be handled correctly or not.
9 A)
explanation: collection of data stored in file is non volatile.
10.A)
explanation: Every file resides in a directory.some computers called directory as folder.


II.
1. Inheritance
explanation: Inheritance is a mechanism that provides parent and child

relationship.
2. polymorphism
explanation: polymorphism is the mechanism to implement same method by

varying different datamembers and functionality.
3. Text file
explanation: Text file contain data that can read in text editor because

data encoded by Ascii or unicode scheme.
4. Catch block
explanation: handles exception thrown by try block.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote