Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 7 pages
Exam (elaborations)

Object Oriented Programming - Exam 1 UPDATED QUESTIONS AND CORRECT ANSWERS

Document preview thumbnail
Preview 2 out of 7 pages

Object Oriented Programming - Exam 1 UPDATED QUESTIONS AND CORRECT ANSWERS The new operator: (a) allocates memory (b) is used to create an object of a class (c) associates an object with a variable that names it. (d) All of the above. - CORRECT ANSWER that names it. (c) associates an object with a variable A method that performs some action instead of returning a value is called a __________ method. (a) null (b) void (c) public (d) private - CORRECT ANSWER (b) void The body of a method that returns a value must contain at least one _________ statement. (a) void (b) invocation (c) throws (d) return - CORRECT ANSWER (d) return

Content preview

Object Oriented Programming - Exam 1
UPDATED QUESTIONS AND CORRECT
ANSWERS
The new operator:

(a) allocates memory

(b) is used to create an object of a class
(c) associates an object with a variable that names it.

(d) All of the above. - CORRECT ANSWER (c) associates an object with a variable
that names it.



A method that performs some action instead of returning a value is called a __________
method.

(a) null

(b) void

(c) public

(d) private - CORRECT ANSWER (b) void



The body of a method that returns a value must contain at least one _________ statement.
(a) void

(b) invocation

(c) throws

(d) return - CORRECT ANSWER (d) return



A variable whose meaning is confined to an object of a class is called:

(a) instance variable

(b) local variable

(c) global variable

(d) none of the above - CORRECT ANSWER (a) instance variable

, In Java, a block is delimited by:

(a) ( )

(b) /* */
(c) " "

(d) { } - CORRECT ANSWER (d) { }



The parameter this refers to

(a) instance variables

(b) local variables

(c) global variables

(d) the calling object - CORRECT ANSWER (d) the calling object



When the parameters in a method have the same as instance variables you can differentiate
them by using the _____ parameter.

(a) String

(b) hidden

(c) default

(d) this - CORRECT ANSWER (d) this



A program whose only task is to test a method is called a:

(a) driver program

(b) stub

(c) bottom-up test

(d) recursive method - CORRECT ANSWER (a) driver program



A set method is:

(a) an accessor method
(b) a mutator method

Document information

Uploaded on
September 20, 2025
Number of pages
7
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$11.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
Sold
69
Followers
2
Items
10308
Last sold
1 week ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions