首 页
大学试题
CMS专题
工学
经济学
专升本
法学
教育学
历史学
更多分类
搜索
题库考试答案搜索网 > 题目详情
当前位置:
首页
>
public class XXK2 { private int a; public XXK2() {a=3;} public XXK2(int aa) {a=aa;} public double f1() { return 2*Math.pow(a,3)+a; } public static void main(String[] args) { XXK2 x=new XXK2(), y=new XXK2(5); System.out.println(x.f1()+", "+y.f1()); } }
>
题目详情
问题题干
答案解析
相关问题
热门问题
最新问题
问题详情
public class XXK2 { private int a; public XXK2() {a=3;} public XXK2(int aa) {a=aa;} public double f1() { return 2*Math.pow(a,3)+a; } public static void main(String[] args) { XXK2 x=new XXK2(), y=new XXK2(5); System.out.println(x.f1()+", "+y.f1()); } }
、<span>57.0, 255.0</span>
、<span>67.0, 255.0</span>
时间:2021-07-17 19:37
关键词:
答案解析
<span>57.0, 255.0</span>
相关问题
下面程序的输出结果是:public class Test{void printValue(int m){do { System .out .println(“The value is”+m);}while(- - m>10);}public static void main(String arg[]){int i=10;Test t= new Test();t.printValue(i);}}
– Susan, will you please go and empty that drawer? –
图1-1所示的电路中,电流I为( )。 图1-1
图1-4所示的电路中包含( )条支路,用支路电流法分析该电路,需要列写( )个方程。 图1-4
建设法律关系的变更主要是指协议变更。
最新问题
public static void main(String[] args) { int i=1, s=0; while(true) { if(i%2==0) s+=i; if(i++>=10) break; } System.out.println("s="+s); }
public static void main(String[] args) { int c0=0, c1=0, c2=0; for(int x=1; x<=20; x++) { switch(x%3) { case 0: c0++; break; case 1: c1++; break; case 2: c2++; break; } } System.out.println("c0,c1,c2="+c0+","+c1+","+c2); }
public class XXK2 { private int a,b; public XXK2(int aa, int bb) {a=aa; b=bb;} public int f1(int x) { if(x>10) return a+b+3*x; else return a*b*x; } public static void main(String[] args) { XXK2 x=new XXK2(3,4); int y=x.f1(8); System.out.println("y="+y); } }
abstract class Shape { int a,b; public Shape(int aa, int bb) {a=aa; b=bb;} abstract public double area(); } class Rectangle extends Shape { public Rectangle(int aa, int bb) {super(aa,bb);} public double area() {return a*b;} } class Triangle extends Shape { public Triangle(int aa, int bb) {super(aa,bb);} public double area() {return a*b/2;} } public class XXK3 { public static void main(String[] args) { Shape x,y; x=new Rectangle(10,20); y=new Triangle(10,15); System.out.println(x.area()+", "+y.area()); } }
public class XXK4 { public static void main(String[] args) { int []a={2,5,8,10,15,20}; int s=0; for(int i=0; i<a.length; i++) s+=a[i]; System.out.println("s="+s); } }
public class XXK4 { public static void main(String[] args) { String []a={"xxk","weirong","xucong","xuxiaohua","baojuan"}; int m=0; for(int i=0; i<a.length; i++) { int n=a[i].length(); if(n>m) m=n; } System.out.println("m="+m); } }
interface Shape { double area(); double girth(); } class Rectangle implements Shape { int a,b; public Rectangle(int aa, int bb) {a=aa; b=bb;} public double area() {return a*b;} public double girth() {return 2*(a+b);} } public class XXK3 { public static void main(String[] args) { Shape x; x=new Rectangle(5,8); System.out.println(x.area()+", "+x.girth()); } }
Public class Test { Public static void main(String[] args) { Vector teamList = new Vector(); teamList.add("Z"); teamList.add("L"); teamList.add("W"); teamList.remove(0); teamList.remove(0); System.out.println(teamList.size()+","+teamList.get(0)); } }
public class XXK4 { public static void main(String[] args) { int [][]a={{2,5,8},{3,6,9},{4,5,6}}; int []b=new int[3]; int i,j; for(i=0; i<a.length; i++) for(j=0; j<a[i].length; j++) b[i]+=a[i][j]; for(i=0; i<b.length; i++) System.out.print(b[i]+" "); } }
class ABC { int a,b; public ABC(int a, int b) {this.a=a; this.b=b;} public int compareTo(ABC x) {return a*b-x.a*x.b;} } public class XXK5 { public static void main(String[] args) { int [][]d={{3,8},{4,6},{5,6},{2,9},{6,7},{5,8}}; ABC []ar=new ABC[d.length]; int i,k=0; for(i=0; i<ar.length; i++) ar[i]=new ABC(d[i][0],d[i][1]); for(i=1; i<ar.length; i++) if(ar[i].compareTo(ar[k])>0) k=i; System.out.println("k="+k); } }
别人在看