public class lcc {
int x,y;
lcc (int a,int b)
{
x=a;
y=b;
}
lcc ()
{
this(1,1);
}
void output()
{
System.out.println(x);
System.out.println(y);
}
void output(int x,int y)
{ this.x=x;
this.y=y;
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
{
lcc pt;
pt=new lcc();
//pt=new lcc(0,0);
// pt.x=10;
//pt.y=10;
pt.output();
}
}
定义静态的 PI 只能在 开始的时候 初始化
非静态 都可以
JAVA
不允许多继承 只允许单继承
int x,y;
lcc (int a,int b)
{
x=a;
y=b;
}
lcc ()
{
this(1,1);
}
void output()
{
System.out.println(x);
System.out.println(y);
}
void output(int x,int y)
{ this.x=x;
this.y=y;
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
{
lcc pt;
pt=new lcc();
//pt=new lcc(0,0);
// pt.x=10;
//pt.y=10;
pt.output();
}
}
定义静态的 PI 只能在 开始的时候 初始化
非静态 都可以
JAVA
不允许多继承 只允许单继承