Skip to main content

Strings

  • Chapter
  • First Online:
Book cover Java 8 Recipes
  • 3475 Accesses

Abstract

Strings are one of the most commonly used data types in any programming language. They can be used for obtaining text from a keyboard, printing messages to a command-line, and much more. Given the fact that strings are used so often, there have been many features added to the String object over time in order to make them easier to work with. After all, a string is an object in Java, so it contains methods that can be used to manipulate the contents of the string. Strings are also immutable in Java, which means that their state cannot be changed or altered. This makes them a bit different to work with than some of the mutable, or changeable, data types. It is important to understand how to properly make use of immutable objects, especially when attempting to change or assign different values to them.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Josh Juneau

About this chapter

Cite this chapter

Juneau, J. (2014). Strings. In: Java 8 Recipes. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-6826-0_3

Download citation

Publish with us

Policies and ethics