Bifalgorithm post · Computer science one · Basics

How can strings be copied and their characters accessed in Java?

How can strings be copied and their characters accessed in Java? (Computer science one · Basics) — "Strings can be copied using the String class’s copy constru…

Ideas in this flowchart

  • Copie des chaînes de caractères en Java
  • Une chaîne peut être copiée avec le constructeur de copie de la classe String.
  • Exemple : String copy = new String(firstName);
  • Les chaînes sont immuables.
  • Il est donc rarement nécessaire de créer une copie profonde d’une chaîne.
  • Les caractères individuels d’une chaîne ne peuvent pas être modifiés.
  • Les caractères individuels peuvent toutefois être consultés.
Feed/

How can strings be copied and their characters accessed in Java?

No cover

Channel

Computer science one

1 page

"Strings can be copied using the String class’s copy constructor:\n\nString copy = new String(firstName);\n\nHowever, since strings are immutable, there is rarely reason to create such a deep copy. Though you can’t change individual characters in a string, you can access them using the 449"

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.