100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

OBJECT ORIENTED PROGRAMMING - EXAM 1 QUESTIONS WITH COMPLETE SOLUTIONS!!

Rating
-
Sold
-
Pages
32
Grade
A+
Uploaded on
23-11-2024
Written in
2024/2025

OBJECT ORIENTED PROGRAMMING - EXAM 1 QUESTIONS WITH COMPLETE SOLUTIONS!!

Institution
OOP
Course
OOP











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
OOP
Course
OOP

Document information

Uploaded on
November 23, 2024
Number of pages
32
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

OBJECT ORIENTED PROGRAMMING - EXAM 1
QUESTIONS WITH COMPLETE SOLUTIONS!!


Real world objects share which two characteristics?
a. Inheritance and polymorphism
b. Classes and interfaces
c. State and behavior
d. Times and dates Answer - C. State and behavior


In object oriented programming how is state represented?


a. Functions
b. Methods
c. Global variables
d. Member Variables Answer - D. Member Variables


What is the purpose of a class in object oriented programming?


a. To create a data structure for functions
b. To create an interface for implementation
c. Serve as the blueprint of how objects will be created
d. To create a data structure for variables Answer - C. Serve as the blueprint of
how objects will be created

,Based on best practices and how the Java API Library is implemented a class
should start with a capital letter (i.e. Dog versus dog).


a. True
b. False Answer - A. True


When defining a class, member variables are included within the class's
open/close curly braces (i.e. {}) and methods are defined outside of the
open/close curly braces.


a. True
b. False Answer - B. False


Information hiding is accomplished via encapsulation


a. True
b. False Answer - A. True


Which of the following is the correct code for instantiating an instance of class
Dog?


a. Dog puppy = Dog;
b. Dog puppy;
c. Dog puppy = Dog();
d. Dog puppy = new Dog(); Answer - D. Dog puppy = new Dog();


Which part of the following statement is the instance or the created object?

,Dog puppy = new Dog();


a. Dog();
b. new
c. puppy
d. Dog Answer - C. puppy


In the following statement, Dog puppy = new Dog();, what is "Dog()" called?


a. Maker
b. Constructor
c. Creator
d. malloc Answer - B. Constructor


Regarding inheritance the existing class is called ____1____ and the new class
is called ____2____. Answer - 1. Superclass
2. Subclass


How many superclasses can a subclass have?


a. 1
b. 2
c. 3
d. unlimited Answer - A. 1


How many subclasses can a superclass have?

, a. 3
b. unlimited
c. 2
d. 1 Answer - B. unlimited


Given the class definition


public class KeyTerminology{}


what is "public" called?


a. Membership level
b. Access level modifier
c. Data type of class
d. Not relevant Answer - B. Access level modifier


What type of implementation behavior is the following class definition doing?


public class SubclassDog extends Dog{}


a. Interface
b. Inheritance
c. Extending
d. Implemenation Answer - B. Inheritance

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
EvaTee Phoenix University
View profile
Follow You need to be logged in order to follow users or courses
Sold
5009
Member since
4 year
Number of followers
3556
Documents
52011
Last sold
17 hours ago
TIGHT DEADLINE? I CAN HELP

Many students don\'t have the time to work on their academic papers due to balancing with other responsibilities, for example, part-time work. I can relate. kindly don\'t hesitate to contact me, my study guides, notes and exams or test banks, are 100% graded

3.8

913 reviews

5
436
4
160
3
166
2
46
1
105

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions