0% found this document useful (0 votes)
9 views4 pages

Java Basics Strings

The document provides an overview of Java string classes, highlighting the differences between String, StringBuilder, and StringBuffer in terms of mutability and thread safety. It also includes string format specifiers for various data types and escape sequences for special characters. This information is essential for understanding string manipulation in Java programming.

Uploaded by

emmasantos2025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

Java Basics Strings

The document provides an overview of Java string classes, highlighting the differences between String, StringBuilder, and StringBuffer in terms of mutability and thread safety. It also includes string format specifiers for various data types and escape sequences for special characters. This information is essential for understanding string manipulation in Java programming.

Uploaded by

emmasantos2025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Java Basics: Strings

Programming Fundamentals in Java


JAVA CLASSES ON STRINGS

Class COMPARATIVE DESCRIPTION


String immutable
StringBuilder mutable. Not threadsafe (not
synchronized)
StringBuffer mutable. Threadsafe.
STRING FORMAT SPECIFIERS

SPECIFIER DESCRIPTION
%d Integer
%s String
%x Hex string of the value
%f Float (to specify 2 decimal places
“%.2f”)
ESCAPE SEQUENCES

SPECIFIER DESCRIPTION
\n New line
\t Tab
\\ Backlash character
\’ Single quote
\’’ Double quote

You might also like