store println in string java code example Example: print string in java String data = "Some string"; System.out.println(data);