• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 2 pages
Exam (elaborations)

MODULE 8: STRINGS- COMPUTER SCIENCE. Trusted by students across multiple disciplines!

Document preview thumbnail
Preview 1 out of 2 pages

MODULE 8: STRINGS- COMPUTER SCIENCE. Trusted by students across multiple disciplines!

Content preview

MODULE 8: STRINGS- COMPUTER SCIENCE.
Trusted by students across multiple disciplines!
What is a String literal? - Answer: A hard-coded literal string value.
E.g.
The "Brittany" in... String name = "Brittany"


What is a String object? - Answer: JVM is forced to create a new String reference, even
if "Brittany" is in the reference pool.


What is a String? - Answer: a sequence of characters enclosed in quotation marks


What will take more time to execute a String literal or a String object? - Answer: String
object will always take more time to execute than String literal because it will
create/build a new string every time it is executed.


Are string mutable or immutable? - Answer: immutable


What backs Strings? - Answer: A character array (char[ ])


Where are Strings stored in memory? - Answer: The String Pool within the heap


How do you get the length of a String? - Answer: Using the String's length method
.length()


.concat() - Answer: Joins two or more strings, and returns a copy of the joined strings


.contains() - Answer: This will check if a sequence of characters is in your String


.touppercase() - Answer: A String method that returns the String without any lower case
letters.


1
APPHIA - Crafted with Care and Precision for Academic Excellence.

Document information

Uploaded on
December 23, 2025
Number of pages
2
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$8.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
Apphia
3.0
(2)
Sold
7
Followers
0
Items
4542
Last sold
2 months 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