DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Proper Java Exception Handling
  • Generics in Java and Their Implementation
  • A Complete Guide on How to Convert InputStream to String In Java
  • Commonly Occurring Errors in Microsoft Graph Integrations and How To Troubleshoot Them (Part 4)

Trending

  • Modular Software Architecture: Advantages and Disadvantages of Using Monolith, Microservices and Modular Monolith
  • Build a Digital Collectibles Portal Using Flow and Cadence (Part 1)
  • Message Construction: Enhancing Enterprise Integration Patterns
  • Unleashing the Power of Microservices With Spring Cloud
  1. DZone
  2. Data Engineering
  3. Data
  4. Java String Tutorials: Become a Java Strings Virtuoso

Java String Tutorials: Become a Java Strings Virtuoso

A deep dive into the world of Java strings, with special attention to Java 8 string tutorials, plus a foray into Java string tutorials for Java 9 and one.

Jordan Baker user avatar by
Jordan Baker
·
Oct. 25, 19 · Presentation
Like (15)
Save
Tweet
Share
34.16K Views

Join the DZone community and get the full member experience.

Join For Free

Intro to Java Strings

Java String
Get Ready to Learn About Java Strings!
  1. String Memory Internals by Tomasz Murkiewicz. The main point to understand here is the distinction between String Java object and its contents - char[] under private value field. String is basically a wrapper around char[] array, encapsulating it and making it impossible to modify so the String can remain immutable. Also the String class remembers which parts of this array is actually used. This all means that you can have two different String objects (quite lightweight) pointing to the same char[].

  2. Top 10 Questions of Java Strings by Ryan Wang. A discussion of ten common questions Java developers face when working with Strings. Though this is a bit of an old post (published in 2013), we hope you'll still find some value in these lessons. 

Java 8 String Tutorials

Java 8 String Make Beautiful Music With Java 8 Strings
  1. Java String Format Examples by Jay Sridhar. This tutorial offers a brief overview, several examples, and a collection of references to keep by your side whenever you are formatting Java strings.

  2. How to Convert an Array to String in Java [Snippet] by Ramesh Fadatare. In this quick article, we’re going to look at different ways to convert an array of strings or integers to a string.

  3. Convert a List to a Comma-Separated String in Java 8 by Mario Pio Gioiosa. This tutorial demonstrates how to use streams in Java 8 and Java 7 to convert a list to a comma-separated string by manipulating the string before joining.

  4. Concatenating Strings in Java 8 by Daniela Kolarova. Brush up on your string concatenation skills with this look at what Java 8 brought, including working with streams and Optionals, as well as general advice.

  5. Two Ways to Join Strings in Java 8 StringJoiner and String.join Examples by Javin Paul. Check out this post to learn more about the two different ways you can join a String in Java 8 — without using a third-party library!

  6. Joining Strings in JDK 8 by Dustin Marx. JDK 8 introduced language features such as lambda expressions, streams, and even the new Date/Time API that changed the way we write Java applications. However, there were also several new APIs and features that might gave beeb less "game changing," but still brought greater convenience and expressiveness to the Java programming language. In this post, we look at one of these smaller features and examine the ability to easily concatenate multiple Strings in JDK 8.

  7. The Do's and Don'ts of Java Strings by Lyndsey Padget. Here are best practices for Java Strings for aspects of coding including i18m, l10n, concatenation, building huge strings, string equality, and comparators.

  8. Java 8 Optional Usage and Best Practices by Hopwell Mutanda. Check out this post where we look at Optional, first introduced in Java 8, how to use it with strings, and best practices for implementing it in your existing projects.

  9. String Representation of Java Decimals Without Scientific Notation by Dustin Marx. Learn how to print your decimal numbers in Java as full strings while skipping the scientific notation for cleaner, more readable outputs.

  10. A Clarified String Formatting Cheatsheet by Alex Theedom. Good to keep close by, this simplified guide to String formatting in Java covers numbers, the available flags, and handling multiple arguments.

  11. We Don't Need StringBuilder for Simple Concatenation by A.N.M. Bazlur Rahman. Concatenating strings is useful, but expensive. Fortunately, you don't need to use StringBuilder anymore - the compiler can handle it for you.

  12. Duplicate Strings: How to Get Rid of Them and Save Memory by Misha Dmitriev. In this performance tutorial, you'll learn why duplicate stings emerge in Java applications and how you can detect and remove them to avoid memory problems.

  13. Java 8 Java.Time Package: Parsing Any String to Date [Code Snippets] by Michael Gantman. Check out this short post on parsing Java Strings into date and time formats. While we don't cover all possible formats, we do look at a good set to start with!

  14. String Interning — What , Why, and When? by Saurabh Chhajed. Learn about string interning, a method of storing only one copy of each distinct immutable string value, and how it's used to improve performance in Java.

  15. UseStringDeduplication: Pros and Cons by Ram Lakshmanan. In this post, we assess the causes of duplicate strings in Java applications, as well as implementing the UseStringDeduplication method and its pros and cons.

Java String Tutorials: Java 9 and Up

Java String
Become a Java String Virtuoso
  1. Compact Strings in Java 9 by Mahmoud Anouti. Explore Java 9's compact strings, including their positive impact on garbage collection and app performance, how to enable them, and how to use them.

  2. JDK 9/10/11: Side Effects From += on Java String by Dustin Marx. In this quick post, we take a look at a peculiar bug present in JDKs 9, 10, and 11 involving how the Java compiler interprets += on Java Strings.

  3. JDK/JEP 280: String Concatentations Will Never Be the Same by Dustin Marx. Since JDK 9, string concatenations have undergone a significant change. Come find out the what and the how in this post with code examples.

  4. Reverse String Alternatives in Java [Snippets] by Talwinder Singh. Check out these example code snippets to learn more about the various ways inwich you can implement a reverse String in your Java code.

  5. New Methods on Java Strings With JDK 11 by Dustin Marx. JDK 11 will probably be bringing a few new methods to the String class! Most of them focus on redefining white space for a more consistent approach.

  6. Java 11 String API Updates by Grzegorz Piwowarek. This post takes a look at some of the new API features presented in the JDK 11 release, specifically the String API and what this means for your next project.

  7. Applying New JDK 11 String Methods by Dustin Marx. A tutorial demonstrates how to use six new String methods in JDK11, including sample code and instructions that will make tasks related to Java Strings easier.

  8. Moving to Java 11: Rediscover Some Gems You Might Have Missed by Andrea Del Bene. In this article, we attempted to summarize the most useful API enhancements introduced since Java 8, including the I/O Stream, class Files, and Path.

  9. The Right Way to Reverse a String in Java by Jonatan Ivanov. Usually, not writing code to solve problems is a good idea — reverse a String using this simpler implementation than more common approaches.

  10. Java 12 String API Updates by Grzegorz Piwowarek. This post explores the newest feature updates to string APIs in Java 12, String#indent(int), String#transform(function), String#describeConstable, and more.

  11. JDK 12: Raw Stirng Literals by Hemambara Vamsi Kotari. This post introduces the upcoming changes to raw string literals in JDK 12, highlighting multi-line strings when compared to earlier releases and more.

  12. The Brief Yet Complicated History of JDK 12's String::transform Method by Dustin Marx. JDK 12 has already seen some turmoil with respect to the String class. We focus on one method and see if it will stay or if it could be on the chopping block.

  13. Java 13 Refcard by Simon Ritter. A Java expert goes everting Java developers need to know about the new JDK 13, walking through code examples to illustrate these new updates and the benefits they bring. Including Java Strings!

  14. Duplicate Objects in Java: Not Just Strings by Misha Dmitriev. In this post, we take a closer look at duplicate objects in Java and how they not only impact strings but other classes as well, including arrays.

  15. Decide if a String Has Duplicates by Zoltan Raffai. Check out this post to learn more about strings in Java and how you can determine if a string has duplicates in your Java code.

Strings Java (programming language) Data Types

Opinions expressed by DZone contributors are their own.

Related

  • Proper Java Exception Handling
  • Generics in Java and Their Implementation
  • A Complete Guide on How to Convert InputStream to String In Java
  • Commonly Occurring Errors in Microsoft Graph Integrations and How To Troubleshoot Them (Part 4)

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: