问题 单项选择题

下列的( )原始类型在使用流时可以互换。

A.byte和boolean

B.char和int

C.byte和char

D.String和char

答案

参考答案:B

解析:【解析】本题考查Java语言中字节类型的概念。在Java语言中,byte是字节类型,用1字节表示;boolean是布尔类型,用true和false表示,它们的表示方法并不一样,也不提供它们之间的转换,选项A错误。Java内部用整数来表示char,通常可以在方法调用和其他语句中互换使用char和int,选项B正确。char用2字节表示,byte字节类型用1字节表示,Java内部也不允许互换使用它们,选项C错误。String在Java语言中是一个类,它提供对字符串的一系列操作,而char是Java语言中的一个基本类型,它不是一个类,两者有本质的区别,故而它们是不能互换使用的,选项D错误。需要注意的是,在Java语言中提供的类都是以大写字母开头,基本类型都用小写字母表示。

单项选择题
问答题

The economic system of the United States is principally one of private ownership. In this system, consumers, producers and government make economic decisions on a daily basis, mainly through the price system. The dynamic interaction of these three groups makes the economic function. The market’s primary force, however, is the interaction of producers and consumers; hence the “market economy” designation.  As a rule, consumers look for the best values for what they spend while producers seek the best price and profit for what they have to sell. Government, at the federal, state, and local level, seeks to promote public security, assure reasonable competition, and provide a range of services believed to be better performed by public rather than private enterprises.  Generally, there are three kinds of enterprises: single-owner operated businesses, partnerships and corporations. The first two are important, but it is the latter structure that best permits the amassing of large sums of money by combining the investments of many people who, as stockholders, can buy and sell their shares of the business at any time on the open market. Corporations make large-scale enterprises possible.The economic system of the United States is principally one of private ownership. In this system, consumers, producers and government make economic decisions on a daily basis, mainly through the price system. The dynamic interaction of these three groups makes the economic function. The market’s primary force, however, is the interaction of producers and consumers; hence the “market economy” designation.