关于找不到符号的问题 方法printf(java.lang.String,java.lang.String)位置:类 java.text.Format Format.printf("%c","#"); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import java.io.*;import java.text.*;import java.util.Locale;public class ContinueLabelTest{ public static void main(String[] args) { nextRow: for(int row=0;row<5;row++) { for(int column=0;column<10;column++) { if(column>row) { System.out.println(); continue nextRow; } Format.printf("%c","#"); } } }}我的源代码是这样的 public class ContinueLabelTest { public static void main(String[] args) { nextRow: for (int row = 0; row < 5; row++) { for (int column = 0; column < 10; column++) { if (column > row) { System.out.println(); continue nextRow; } System.out.format("%c", '#');//这样就可以输出啊! } } }}不明白你要干什么? #为什么要用单引号才能输出呢?它不能作为string吗?我是初学者,能解释下吗? Format.printf("%c","#"); //%c说明是字符,所以用'#',%s是字符串,用"#"注意一下字符和字符串的区别 JDBC和数据库类型的问题 double 数做乘法精度问题 java实现多级部门组装成xml体的问题 [求助]请高手指点:ASP中文本框的自动换行 如何给JTextField添加事件监听阿 一个java语言面试题,很有意思!看看大家不用上机能不能回答的对 构造方法 为什么没有结果呢!!! Java帮助的下载 有谁知道jdbc哪里有下载的,告诉我谢谢了!! Java 应用程序中如何调用chm文件 匀速输出一个List里对象的方法
import java.text.*;
import java.util.Locale;
public class ContinueLabelTest
{
public static void main(String[] args)
{
nextRow:
for(int row=0;row<5;row++)
{
for(int column=0;column<10;column++)
{
if(column>row)
{
System.out.println();
continue nextRow;
}
Format.printf("%c","#");
}
}
}
}
我的源代码是这样的
public static void main(String[] args) {
nextRow: for (int row = 0; row < 5; row++) {
for (int column = 0; column < 10; column++) {
if (column > row) {
System.out.println();
continue nextRow;
}
System.out.format("%c", '#');//这样就可以输出啊!
}
}
}
}不明白你要干什么?
注意一下字符和字符串的区别