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 12 pages
Exam (elaborations)

COP 3330 PRACTICE EXAM QUESTIONS AND COMPLETE SOLUTIONS.

Document preview thumbnail
Preview 2 out of 12 pages

COP 3330 PRACTICE EXAM QUESTIONS AND COMPLETE SOLUTIONS WITH VERIFIED ANSWERS GRADED A+

Content preview

COP 3330 PRACTICE EXAM
QUESTIONS AND COMPLETE
SOLUTIONS
QUESTIONS AND ANSWERS
Consider the following Java statements:
int x = 9;
double y = 5.3;
result = calculateValue(x, y);


Which of the following statements is false?
a. A method is called with its name and parentheses.
b. x and y are parameters.
c. Copies of x and y are passed to the method calculateValue.
d. x and y are arguments.. ANSWER -B. x and y are parameters


What would be the output of following program.
class Main { public static void main(String args[]) {
try {
throw 10;

, }
catch(int e) {
System.out.println("Got the Exception " + e);
}
}
}
a. Got the Exception 10
b. Got the Exception 0
c. Compile Error
d. Throws 10. ANSWER -C. No exception of type int can be thrown; an exception type
must be a subclass of Throwable


A method is invoked with a(n). ANSWER -method call


A variable known only within the method in which it's declared is called a(n). ANSWER -
local variable


The _____ statement in a called method can be used to pass the value of an expression back
to the calling method. ANSWER -return


The keyword _____ indicates that a method does not return a value. ANSWER -void


Data can be added or removed only from the ___ of a stack. ANSWER -top


Stacks are known as ____ data structure; the last item pushed (inserted) onto the stack is
the first item popped (removed) from the stack.. ANSWER -Last-in First-out


Three ways to return control from a called method to a call are _____, ______, and ______.
ANSWER -Return, return expression, and encountering the closing right brace of a method


An object of class ____ produces truly random numbers.. ANSWER -Secure-Random

Document information

Uploaded on
November 11, 2025
Number of pages
12
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$11.39

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

Sold
8
Followers
0
Items
1088
Last sold
1 month 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