String concatenation: The + contains null : String Concatenation « Data Type « Java Tutorial






public class MainClass {

  public static void main(String[] arg) {
    String myString = "String a" + null;
  
    System.out.println(myString);
  }

}
String anull








2.22.String Concatenation
2.22.1.String concatenation: '+' operation generates a new String object
2.22.2.String concatenation: The + contains null
2.22.3.String concatenation: Convert an integer to String and join with two other strings
2.22.4.String concatenation: Combining a string and integers
2.22.5.String concatenation: Combining integers and a string
2.22.6.Substring replacement.
2.22.7.Pad string
2.22.8.Padded String
2.22.9.Return a string padded with the given string for the given count.