试题与答案

注意:下面出现的“考生文件夹”均为%USER%在考生文件夹下存有文件名为Java_1

题型:问答题

题目:

注意:下面出现的“考生文件夹”均为%USER%

在考生文件夹下存有文件名为Java_1.java文件,请完善Java_1.java文件,并进行调试,使程序输出结果如下:

由于Java_1.java文件不完整,请在注释行“//*********Found*********”下一行语句的下画线地方填入正确内容,然后删除下画线,请勿删除注释行或其他已有语句内容。存盘时,文件必须存放在考生文件夹下,不得改变原有文件的文件名。

给定源程序:

import javax.swing.*;

public class Java_1

public static void main(String args[])

//*********Found**********

StringBuffer buf=new______("Hello, how are you");

String output="buf="+bur.toString()+

"\nlength="+buf.length()+

"\ncapacity="+buf.capacity();

buf.ensureCapacity(75);

output+="\n\nNew capacity="+buf.capacity();

buf.setLength(10);

output+="\n\nNew length="+buf.length()+

"\nbuf="+buf toString();

JOptionPane.showMessageDialog(null, output,

"字符串缓存长度和容量的实例",

//*********Found**********

JOptionPane.______);

//*********Found**********

System.______(0);

 

答案:

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

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

参考答案:B

试题推荐
题型:单项选择题

场景(二) 甲房地产开发公司与乙建筑工程公司签订工程承包合同,由乙建筑工程公司承建甲房地产开发公司开发的一栋高级公寓工程。合同约定了具体的工程进度要求,甲房地产开发公司按照工程进度支付工程款。在履行合同过程中,由于施工技术落后,乙建筑工程公司没有在合同约定的期限内完成相应的第一期工程,甲房地产开发公司因此拒绝向乙建筑工程公司全颧支付约定的工程款。
根据场景(二),回答下列问题:

应当后履行合同的一方抽逃资金,以逃避债务,先履行合同的一方可行使( )。

A.同时履行抗辩权

B.撤销权

C.后履行抗辩权

D.不安抗辩权

查看答案
题型:阅读理解

阅读理解。

     There are many types of reports. A report is simply an account of something that has happened. The

commonest are news reports. We get them in themselves, over radio and on television. Sometimes cinemas

also show us newsreels. The main purpose of a newspaper is to provide news. If you examine a newspaper

closely, you will find that there are all types of news: accidents, floods, fires, wars, fashions (服装), sports,

books, etc. The news covers everything that happens to people and their surroundings. Sometimes there are

news items which are very amusing.

      A news report is usually very short, except when it is about something very important, but it contains (包

含) a lot of information. It is also written in short paragraphs, the first paragraph is in fact a summary (总结)

of the news item. It gives all the necessary information, what, when, where, how and why. The other

paragraphs give full details of the subjects. There may also be interviews with people. The words actually

spoken by them are within inverted commas (引号). Often there are photographs to go with the news to make

it more interesting.

1. The easiest way to get today's news is _______.

A. to go to the cinema

B. to watch a color TV

C. to read today's newspaper

D. to listen to the music over radio

2. Newspaper sell well mainly because_______.

A. they cost very little

B. they are easy to get

C. they have got pictures to go with the news

D. they provide all sorts of news in them

3. If you want to get enough information about yesterday's traffic accident within a very short time,

    you'd better ______.

A. read the first paragraph of the news report in today's newspaper

B. start from the second paragraph of the news report in today's newspaper

C. look through the whole news report in today's newspaper

D. talk with people who have seen the accident

4. To interest more people, a news reporter ______.

A. usually produces amusing news

B. always writes very short news reports

C. often prints pictures to go with the news

D. sometimes provides long and important news

5. This passage mainly talks about ______.

A. different types of reports

B. news reports

C. happenings to people and their surroundings

D. the length of a news report

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