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)

CMSC131 FINAL EXAM PREP QUESTIONS WITH VERIFIED ANSWERS

Document preview thumbnail
Preview 2 out of 7 pages

CMSC131 FINAL EXAM PREP QUESTIONS WITH VERIFIED ANSWERS

Content preview

CMSC131 FINAL EXAM PREP QUESTIONS WITH
VERIFIED ANSWERS

The following declaration is possible:
public class Foo extends A implements B, C {
...
} - Answers - true

Where is a "current object" present? - Answers - Constructors and Instance methods

If you were taking an introductory programming course in the 1980's, which of these
languages is most likely to have been taught? - Answers - Pascal

Which of the following are considered "secondary memory devices." - Answers - USB
flash drive and hard drive

How many different values can be represented by 4 bits? - Answers - 16 (2^4)

What term describes the situation where two different variables refer to the same
object? - Answers - aliasing

How is your Java source code translated into machine code? - Answers - First a
compiler then an interpreter

What kinds of variables are stored on the call stack? - Answers - Local variables and
parameters

The following code fragment will compile:
int y = 5;
if(y < 10) {
int x = 17;
}
System.out.println(x); - Answers - False

What term describes 2^20 bytes of space? - Answers - megabyte

What kind of variables are used to represent the "state" of objects? - Answers - instance
variables

What advantages does primary memory have over secondary memory? - Answers -
Faster

Which of the following is the best definition for the term "byte"? - Answers - A sequence
of 8 bits

, What is the output of the following code fragment?
for(int x = 7; x < 11; x= x*2){
x-=3;
System.out.print(x)
} - Answers - 457

Which of the following will compile?
A. byte a = 17;
B. double c = 15F;
C. String e = 'x';
D. int b = 15L;
E. byte d = 130; - Answers - A, B

List the following operators in order of precedence (highest to lowest)
|| < += && == - Answers - < == && || +=

Write the binary representation of the number 50 - Answers - 110010

How many Dog objects are created by following code fragment?
Dog a = new Dog ("Spot"), c = new Dog("Alfie");
Dog b;
Dog d = a;
Dog f = new Dog(a); - Answers - 3

After the following code has been executed, how many objects have become garbage?
Dog a = new Dog( );
Dog b = new Dog( );
b = a;
a = new Dog( );
a = new Dog( ); - Answers - 2

After the following code has been executed, what is the value of the variable y?
int x =5, y = 10;
if(x++ == 5 || --y > 50){
y+=4;
} - Answers - 14

Assume that the following code has been executed.
String a = new String("bozo");
String b = a;
String c = new String(b);
Which of the following boolean expressions will evaluate as true?
a ==b
a.equals(c)
b==c - Answers - a==b

Document information

Uploaded on
July 10, 2026
Number of pages
7
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

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.
GEEKA
3.8
(361)
Sold
2137
Followers
1449
Items
58515
Last sold
2 days 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