问题 问答题

在程序中,给出两个整数4和5,计算他们的和,并在屏幕上显示出来。请将程序补充完整。
注意:请勿修改main()主方法和其他已有语句内容,仅在横线处填入适当语句。
______Add

private int a;
private int b;
public Add(int n1,int n2)

a=nl;
b=n2;

public int getAdd()

return a +b;


public class basic

public ______void main(String[] args)

int n1=4, n2=5;
Add aAddB=______Add(nl,n2);
System.out.println("4+5="+aAddB.getAdd());

答案

参考答案:class
new
static

解析:[讲解] 本题考查知识点:面向对象编程的基本概念和特征,类的基本组成和使用,对象的生成和使用。解题思路:本题主要考查Java编程中类的使用。主方法生成Add类对象的实例aAddB,然后调用getAdd()方法计算出4加5的和。首先,定义类必须使用关键字class,因此第1个空应该填写class。在生成类的对象时,必须使用关键字new,由此得到第2个空。 Main方法作为Java的一个特殊方法,其最大的特点就是这个方法始终都是静态的,因为一个程序必须要有一个静态的入口,系统才能对其进行调用,所以第3个空应该填写static。

填空题

[A] The petitioners argue that repealing the tax will cost the Treasury billions of dollars in lost revenues and will result in either increased taxes in the long run or cuts to Medicare, Social Security, environmental protection and other government programs. Repealing the levy "would enrich the heirs of America’s millionaires and billionaires, while hurting families who struggle to make ends meet," the petition says.

[B] About 120 wealthy Americans had signed or supported a petition to oppose phasing out the tax. President Bush has included the repeal of the tax in his $1.6 trillion tax-cut proposal. Normally when "dozens" of Americans join in a political cause, it is not particularly noteworthy, but in this case the dozens include: George Soros, a billionaire financier; Warren Buffett, an investor listed as America’s fourth-richest person; the philanthropist David Rockefeller Jr. ; and William Gates Sr. , a Seattle lawyer and father of America’s richest man, Microsoft Corp. Chairman Bill Gates.

[C] Buffett and company cite these factors in their petition calling for opposition to the estate-tax repeal. They also discuss something that’s equally emotional and far more complex: the principle of meritocracy. The idea that everyone in America has an equal chance, that our fates are not determined by accidents of birth, is one of our core values. And nowhere is this principle more revered than in the technology economy; entrepreneurship is almost by definition an expression of meritocracy.

[D] Buffett told the Times that repealing the estate tax would be a "terrible mistake" and the equivalent of "choosing the 2020 Olympic team by picking the eldest sons of the gold medal winners in the 2000 Olympics. "

[E] An old brokerage commercial says: "He made his money the old-fashioned way: He earned it." There was a perfect parody of the ad in which the line read: "He made his money the old-fashioned way: He inherited it. " In 20 or 50 or 100 years, which of these lines will be right Buffett and Soros and friends, to their credit, want to help make the first one real. Let’s hope this is only one step in that process.

[F] It was refreshing to see Buffett and George Soros and a number of other extremely wealthy luminaries stand up in opposition to President Bush’s proposed repeal of the estate tax. While the policy has some emotional attractions—it would protect the inheritors of some small businesses from having to sell the companies to pay taxes, and it is true that most people have been taxed on their savings once already—in practice the tax repeal would mainly be a windfall for a very small number of very, very rich people.

[G] President will make his case for his $1.6 trillion tax cut plan, delivering a speech at a community center in St. Louis. The proposal would slash federal tax rates across all levels of income, eliminate the so-called marriage penalty and phase out estate taxes. Democrats complain that the plan—which would cut the top rate from 39 to 33 percent—would disproportionately benefit the wealthy and unnecessarily squander expected budget surpluses. Some of the richest Americans are urging Congress not to repeal the estate tax, The New York Times reported on Wednesday. (Feb. 14)

Order:

44()

问答题 简答题