九九乘法表:使用"类名.方法名" 调用静态方法
public class ChenFaBiaoDemo {
/**
* <p> 九九乘法表</p>
* <p>使用 "类名.方法名" 调用静态方法</p>
* @created on 2012-4-24
*/
public static void main(String[] args) {
ChenFaBiao.print();
}
}
class ChenFaBiao {
public static void print() {
System.out.println("小学生读九九乘法表:");
for (int i = 1; i < 10; i++) {
for (int j = 1; j < 10; j++) {
if (j <= i) {
if (i == j) {
System.out.println(i + "*" + j + "=" + i * j);
continue;
} else {
System.out.print(i + "*" + j + "=" + i * j + " ");
}
}
}
}
}
}
>>
It is really my honor to share my experience together,and welcome to discuss problems with me.
posted on 2012-05-10 17:56 Alfred__Lee 阅读(223) 评论(0) 收藏 举报
浙公网安备 33010602011771号