3 回答

TA贡献1752条经验 获得超4个赞
试试这个:(不确定你已经做了多少改变)
public class Oops3 {
public static void printer(double x, double y) {
System.out.println("x = " + x + " and y = " + y);
System.out.println("The value from main is: " + y);}
public static void main(String[] args) {
int z = 5;
double y = 867.5309;
double x = 10.01;
System.out.println("x= " + x + " and y = 8.0");
printer( x,y);
System.out.println("z = " + z);
}}

TA贡献1798条经验 获得超3个赞
以下是您要查找的工作代码
public class Oops3
{
public static void printer(double x, double y, int z) {
System.out.println("x = " + x + " and y = " + y);
System.out.println("The value from main is: " + y);
System.out.println("z = " + z);
}
public static void main(String[] args) {
Oops3 O=new Oops3();
double y = 867.5309;
double x = 10.01;
int z = 5;
O.printer(x, y, z);
}
}

TA贡献1886条经验 获得超2个赞
这段代码对我有用
public class Oops3 {
public static void main(String [] args) {
Oops3 i = new Oops3();
double bubble = 867.5309;
double x = 10.01;
double y = 8.0;
int z = 5;
i.printer(x, y);
i.printer(x, bubble);
System.out.println("The value from main is: " + bubble);
System.out.println("z = " + z);
}
public static void printer(double x, double y) {
System.out.println("x = " + x + " and y = " + y);
}
}
添加回答
举报