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 1 out of 2 pages
Exam (elaborations)

CMSC 131 FINAL EXAM QUESTIONS WITH VERIFIED ANSWERS

Document preview thumbnail
Preview 1 out of 2 pages

CMSC 131 FINAL EXAM QUESTIONS WITH VERIFIED ANSWERS

Content preview

CMSC 131 FINAL EXAM QUESTIONS WITH VERIFIED
ANSWERS


What is the Java Virtual Machine? - Answers - A program that simulates a real CPU
running compiled Java code.

What is byte code? - Answers - The Java compiler translates Java source code into
byte code, which is an intermediate language. The Java Virtual Machine executes the
byte code instructions.

How can you generate bytecode for a program called Test.java? - Answers -

What is the difference between a syntax error and a run time error? - Answers - Syntax
errors are related to the structure of the code and are detected before the program is
run, while runtime errors occur during the execution of the program

Can every class in Java have a main method? - Answers - No

What is the default value for a local variable? - Answers - None

What is the default value for a local variable? - Answers - The negative answer (int (and
the like)= 0, boolean = false, Object = null)

How do the String and StringBuffer classes differ? - Answers - You use the String class
when you are working with strings that cannot change while StringBuffer is used when
you want to manipulate the contents of the string on the fly.

What is the difference between method overloading and method overriding? - Answers -
Method overloading is used to increase the readability of the program. Method
overriding is used to provide the specific implementation of the method that is already
provided by its super class.

What is the difference between final int x and final static int x? - Answers - Final int
belongs to each individual int object while final static int is class wide.

What is the difference between a shallow copy and a deep copy? - Answers - In
Shallow copy, a copy of the original object is stored and only the reference address is
finally copied. In Deep copy, the copy of the original object and the copy are both stored

Which two methods of the Object class do we often override? - Answers - equals()
toString()

Document information

Uploaded on
July 10, 2026
Number of pages
2
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$9.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