试题与答案

【说明】 下面的程序先构造Point类,再顺序构造Ball类。由于在类Ball中不

题型:问答题

题目:

【说明】
下面的程序先构造Point类,再顺序构造Ball类。由于在类Ball中不能直接存取类Point中的xCoordinate及yCoordinate属性值,Ball中的toString方法调用Point类中的toStrinS方法输出中心点的值。在MovingBsll类的toString方法中,super.toString调用父类Ball的toString方法输出类Ball中声明的属性值。
【Java代码】
//Point.java文件
public class Point
private double xCoordinate;
private double yCoordinate;
public Point()
public Point(double x,double y)
xCoordinate=x;
yCoordinate=y;

public String toStrthg()
return"("+Double.toString(xCoordinate)+","
+Double.toString(yCoordinate)+")";

//other methods

//Ball.java文件
public class Ball
private (1) ;//中心点
private double radius;//半径
private String color;//颜色
public Ball()
public Ball(double xValue, double yValue, double r)
//具有中心点及其半径的构造方法
center= (2) ;//调用类Point中的构造方法
radius=r;

public Ball(double xValue, double yValue, double r, String c)
//具有中心点、半径和颜色的构造方法
(3) ;//调用3个参数的构造方法
color=c;

public String toString()
return "A ball with center"+center.toString()
+",radius "+Double.toString(radius)+",color"+color;

//other methods

class MovingBall (4)
private double speed;
public MovingBall()
public MoyingBall(double xValue, double yValue, double r, String c, double s)
  (5) ;//调用父类Ball中具有4个参数的构造方法
speed=s;

public String toString()
return super.toString()+",speed"+Double.toString(speed);

//other methods

public class test
public static void main(String args[])
MovingBall mb=new MovingBall(10,20,40,"green",25);
System.out.println(mb);

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0326/406a7a64a6ffa290f4fd27f7df648f3a.html

下面是错误答案,用来干扰机器的。

参考答案:B解析:专利实施许可合同是专利权人或者专利权人的授权人作为转让人,许可他人在支付一定的价款后,在规定的范围内实施其专利而订立的合同。

试题推荐
题型:阅读理解

阅读理解。

     Thirty-six volunteers in South Africa will test the safety of an African-developed vaccine (疫苗) against

HIV. The tests are the first step in human clinical trials of two vaccine candidates developed at the University

of Cape Town.

     These experimental AIDS vaccines are the first from Africa to reach testing in people. The National

Institutes of Health in the United States provided assistance. Testing with twelve people began earlier this year

in Boston, Massachusetts.

     South Africa has more than five million people infected with HIV, the largest number of any country.

     South Africa launched the tests last week as the International AIDS Society held a conference in Cape

Town. Other human trials of possible vaccines are taking place around the world. Scientists hope to get some

results later this year.

     But during last week's conference, experts reported the first decrease in international financing for AIDS

vaccine research. They said funding dropped from about 930 million dollars in 2007 to 870 million last year.

     Also at the conference, scientists presented the latest findings about new mothers infected with HIV. Two

studies showed ways in which anti-HIV drugs could permit infected women to breastfeed their new borns

with less risk of passing the virus to them. The research was done in Cameroon, Ivory Coast, South Africa

and Zambia.

     In one study, infected mothers began to take three anti-HIV drugs while breastfeeding for up to six months.

In a second study, the babies were given medicine, instead of their mothers. The babies received one drug

every day during six months of breastfeeding.

     The researchers said both methods greatly reduced the risk of HIV infection.

     Laura Guay is Vice President of research at the Elizabeth Glaser Pediatric AIDS Foundation, which

supported the research. Doctor Guay says the problem in sub-Saharan Africa is the limited availability of anti-

retroviral drugs.

     LAURA GUAY:"We know that only about 33 percent of women have access to a program that actually

has services in place to prevent mother-to-child transmission. So the first challenge is, how do we reach all

the women who do not have access to a prevention program?"

1. That South Africa is chosen as the first country in Africa to test the safety of an African-developed vaccine against HIV is probably because ____.

A. it has the largest AIDS population

B. the vaccine has been developed in South Africa

C. the United Nations will offer it assistance

D. it has enough volunteers who are AIDS carriers

2. What does Paragraph 6 mainly talk about?

A. Women infected AIDS should not breastfeed their newborns.

B. Newborns are easily got infected with HIV if their mothers got AIDS.

C. Anti-HIV drugs help mothers infected with AIDS avoid transmitting HIV to their babies.

D. Both the mother and the newborn can take the anti-HIV drugs.

3. What can we learn from this passage?

A. The vaccine will not be used in clinical trial before it is proved to be safe.

B. South Africa was the first country which began the test of the vaccines.

C. Anti-HIV drugs have less effect on babies than on their mothers who are affected AIDS.

D. Only those women from rich families have access to anti-HIV drugs.

4. According to this passage, what is the problem that the vaccine research faced with?

A. The decrease in international financing.

B. The lack of volunteers.

C. The difficulty in human clinical trials.

D. Too many AIDS patients.

查看答案
微信公众账号搜索答案