【Java】用10种不同的方法输出“Hello World”
1个回答
2014-06-29
展开全部
System.out.printf("%s","Hello World");
System.out.printf("%s%s","Hello"," World");
System.out.printf("%s W%s","Hello","orld");
System.out.printf("H%s W%s","ello","orld");
System.out.printf("He%s W%s","llo","orld");
System.out.printf("Hel%s W%s","lo","orld");
System.out.printf("Hell%s W%s","o","orld");
System.out.printf("Hell%s Wo%s","o","rld");
System.out.printf("Hell%s Wor%s","o","ld");
System.out.printf("Hell%s Worl%s","o","d");
更多追问追答
追问
少年,顺序反了,变成WorldHello了。= =
追答
你要求的字符串,我一没加空格二没加换行,所以看起来比较奇怪而已。内容不可能有问题
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询