62,621
社区成员
发帖
与我相关
我的任务
分享public class Study
{
public static void main(String[] args)
{
Employee a = new Employee(50, 60);
System.out.println(a.salary);
System.out.println(a.x);
System.out.println(a.y);
}
}
class Employee
{
double salary;
public Employee(double x, double y)
{
salary = 30;
}
}

class Employee
{
double salary;
double x, y;
public Employee(double x, double y)
{
this.x = x;
this.y=y;
salary = 30;
}
}
要先声明出来x,和y