标签: java eclipse netbeans
我希望程序打印C#。
C#
我尝试使用System.out.println("A car with {0} wheels created", wheels); {0}或{1}中的占位符:virtual
System.out.println("A car with {0} wheels created", wheels);
virtual
答案 0 :(得分:1)
使用+作为连接字符串的方法,如下所示:
+
System.out.println("A car with " + wheels + " wheels has been created.")车轮是您的变量
System.out.println("A car with " + wheels + " wheels has been created.")