From cddd01ecef0f0dbf65dcc3033e7ae869e290db09 Mon Sep 17 00:00:00 2001 From: Brent Willems Date: Sun, 18 Nov 2018 16:44:42 +0100 Subject: [PATCH] added some info about System.out.printf() method (#22070) printf() method uses a stringbuilder wich is more efficient in memory --- guide/english/java/strings/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guide/english/java/strings/index.md b/guide/english/java/strings/index.md index 7d9e5f9d70..b436c75959 100644 --- a/guide/english/java/strings/index.md +++ b/guide/english/java/strings/index.md @@ -69,6 +69,10 @@ public class StringExample{ } } ``` +If you want to print a string with values in Java it is better to use the following: + System.out.printf("example text with %s",value); //where value is a parameter + +This uses the StringBuilder Class wich is more efficient for memory. Output: ```