//静态化方法 类名.方法();
public class Demo05 {
public static void main(String[] args) {
Demo.draw(2, 3);
}
}
class Demo{
public static void draw(int x,int y){
for(int i=0;i
结果:
* * *
* * *
//实例化方法 对象.方法();
public class Demo06 {
public static void main(String[] args) {
Demo06 d1=new Demo06();
//要先创建对象
d1.draw(3, 4);
}
public void draw(int x,int y){
for(int i=0;i
结果:
* * * *
* * * *
* * * *



