java string functions programs code example Example 1: how to make a string java String newString = "Hello World"; Example 2: string java String str = "abc";