class point {
int x , y;
public point(int a, int b ){
x=a; y=b;
//System.out.println(a+" "+b);
}
//System.out.println(a+" "+b);
}
public class AtwoPoint{
public static void main(String [ ]args){
point p1= new point ( ), p2= new point ( );
p1.x=10; p1.y=20;
p2.x=30; p2.y=40;
System.out.println("x = "+ p1.x +" y= "+p1.y);
System.out.println("x = "+ p2.x +" y= "+p2.y);
//System.out.println(p.a+" "+p.b);
=============================================
你给我从上面的代码中找出定义p的语句来,你都没有定义,怎么可能可以调用p呢
你只定义了p1,p2
int x , y;
public point(int a, int b ){
x=a; y=b;
//System.out.println(a+" "+b);
}
//System.out.println(a+" "+b);
}
public class AtwoPoint{
public static void main(String [ ]args){
point p1= new point ( ), p2= new point ( );
p1.x=10; p1.y=20;
p2.x=30; p2.y=40;
System.out.println("x = "+ p1.x +" y= "+p1.y);
System.out.println("x = "+ p2.x +" y= "+p2.y);
//System.out.println(p.a+" "+p.b);
=============================================
你给我从上面的代码中找出定义p的语句来,你都没有定义,怎么可能可以调用p呢
你只定义了p1,p2
可惜不是你,陪我到最后