重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 行业知识> 财会/税务
网友您好,请在下方输入框内输入要搜索的题目:
搜题
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
题目内容 (请给出正确答案)
[主观题]

class A{public static int max(int a,int b){return a>b?a:b;}public static void main(Stri

class A{public static int max(int a,int b){return a>b?a:b;}public static void main(Stri

class A{

public static int max(int a,int b){

return a>b?a:b;

}

public static void main(String args[]){

System.out.println(“max=”+max(5,23));

}

}

答案
查看答案
更多“ class A{public static int max(int a,int b){return a>b?a:b;}public static void main(Stri”相关的问题

第1题

接口Animal 定义如下:public interface Animal{void Move();}则下列抽象类的定义中,哪些是不合法的?()

A.abstract class Cat: Animal

{

abstract public void Move();

}

B.abstract class Cat: Animal

{

virtual public void Move(){Console.Write(Console.Write("Move!");)}

}

C.abstract class Cat: Animal

{

public void Move(){Console.Write(Console.Write("Move!");)};

}

D.abstract class Cat: Animal

{

public void Eat(){Console.Write(Console.Write("Eat!");)};

}

点击查看答案

第2题

给出下面代码的输出()public class Test {public static void main(String[ ] args) {int[][]

A.0

B.1

C.2

D.4

点击查看答案

第3题

已知类定义如下,其中Shape 为基类, Circle 和Rectangle 分别Shape 的直接派生类, Square 为R
ectangle 的直接派生类和Shape 的间接派生类。请模仿Rectangle 类,写出Circle 类的所有成员函数。

/****************** 文件shape.h*************************/

const float PI=3.14159f; // 定义圆周率常量

class Shape // 几何图形抽象类

{

public:

virtual float GetPerimeter()=0; // 纯虚函数,计算周长

virtual float GetAre()=0; // 纯虚函数,计算面积

};

class Rectangle: public Shape // 矩形类

{

public:

Rectangle (float len,float wid):length(len),width(wid){}

~Rectangle (){}

float GetPerimeter() {return 2*(length width);} // 计算矩形周长

float GetAre() {return length*width;} // 计算矩形面积

private:

float length, width; // 矩形的长和宽

};

class Circle: public Shape // 圆类

{

public: // 在下面编写每个成员函数

private:

float rad; // 圆的半径

};

class Square: public Rectangle // 正方形类

{

public:

Square(float len): Rectangle(len,len){}

~Square(){}

};

点击查看答案

第4题

仔细阅读下面的程序,判断有几处错误。()import android.os.Bundle; public class HelloActivity{ public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.xx); } }()

A.1

B.2

C.3

D.4

点击查看答案

第5题

写出以下程序的运行结果

class A

{

int a;

A(int b)

{a=b;}

void show()

{System.out.println(“a=”+a);}

}

public class Class1

{

public static void main (String args[])

{

A bj=new A(12345);

boolean b=false;

char ch=97;

obj.show();

System.out.println(“b=”+b+”/tch=”+ch);

}

}

点击查看答案

第6题

写出以下程序的运行结果。public class Test2 {public static void main(String args[ ]){int i,j

写出以下程序的运行结果。public class Test2 {public static void main(String args[ ]){int i,j;int a[]={17,91,65,35,28};for (i = 0; i < a.length-1; i++ ) {int k = i;for(j = i; j < a.length; j++ )if (a[j]>a[k] )k = j;int temp =a[i];a[i] = a[k];a[k] = temp;}for (i =0; i<a.length; i++ )System.out.print(a[i]+" ");System.out.println();} }

点击查看答案

第7题

第十行的声明将调用哪些方法?()1 class Person {2 public void printValue(int i, int j) { }

A.第4行的方法

B.第3行的方法

C.第6行的方法

D.第7行的方法

点击查看答案

第8题

若有以下程序:#include using namespace std ; class Point { int x, y; public :Point () {
若有以下程序:#include using namespace std ; class Point { int x, y; public :Point () {

若有以下程序:

#include using namespace std ; class Point { int x, y; public :

Point () { x = 0; y = 0; } void SetPoint (int x1, int y1) { x = x1; y = y1; } void DisPoint () { cout << "x=" << x << "," << "y=" << y << endl ; } }; int main() { Point * p = new Point ; p-> SetPoint (5, 12); p-> DisPoint (); delete p; return 0; } 上面程序的输出结果为:

点击查看答案

第9题

There was a woman in Detroit, who had two sons.She was worried about them, especially
the younger one, Ben, because he was not doing well in school.Boys in his class made jokes about him because he seemed so ___1___.

The mother decided that she would herself have to get her sons to do better in school.She told them to go to the Detroit Public Library to read a book a week and do a book report for her.

One day, in Ben's ___2___, the teacher held up a rock and asked if anyone knew it.Ben put up his hand and the teacher let him ___3___."Why did Ben put up his hand?" his classmates wondered."He never said anything.What could he possibly want to say?"

Well, Ben not only ___4___ the rock, but also said a lot about it.He named other rocks in its group and even knew where the teacher had found it.The teacher and the students were surprised.Ben had learned all this from doing one of his book reports.

Ben later went on to the ___5___ of his class.When he finished high school, he went to Yale University and at last became one of the best doctors in the United States.

1、A.top

B.slow

C.class

D.answer

E.knew

2、A.top

B.slow

C.class

D.answer

E.knew

3、A.top

B.slow

C.class

D.answer

E.knew

4、A.top

B.slow

C.class

D.answer

E.knew

5、A.top

B.slow

C.class

D.answer

E.knew

点击查看答案

第10题

阅读下列代码,选出该代码段正确的文件名?()class A{void method1(){System.out.println(&quo

A.java

B.class

C.java

D.class

点击查看答案

第11题

Class Two ________ all out on the playground now.

A.is

B.was

C.are

D.were

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案 购买前请仔细阅读《购买须知》
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《服务协议》《购买须知》
立即支付 系统将自动为您注册账号
已付款,但不能查看答案,请点这里登录即可>>>
请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝