java:class Test { int x = 10, y = 20; i
java:classTest{intx=10,y=20;intmv(doubler,doubles){x=r;y=s;returnx+y;}intmv(doublew,i...
java:class Test {
int x = 10, y = 20;
int mv(double r, double s) {
x = r;
y = s;
return x+y;
}
int mv(double w, int q) {
x = w%2;
y = q%2;
return x+y;
}
}
public class jpyu {
public static void main(String[ ] argv){
Test c = new Test();
System.out.println(c.mv(7.5, 6));
}
}
What is the result of attempting to compile and run
the above program ? 展开
int x = 10, y = 20;
int mv(double r, double s) {
x = r;
y = s;
return x+y;
}
int mv(double w, int q) {
x = w%2;
y = q%2;
return x+y;
}
}
public class jpyu {
public static void main(String[ ] argv){
Test c = new Test();
System.out.println(c.mv(7.5, 6));
}
}
What is the result of attempting to compile and run
the above program ? 展开
2个回答
展开全部
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from double to int
Type mismatch: cannot convert from double to int
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询