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