单选题Given that c is a reference to a valid java.io.Console object, and: 11.String pw = c.readPassword("%s", "pw: "); 12.System.out.println("got " + pw); 13.String name = c.readLine("%s", "name: "); 14.System.out.println(" got ", name); If the user types fi

题目
单选题
Given that c is a reference to a valid java.io.Console object, and: 11.String pw = c.readPassword("%s", "pw: "); 12.System.out.println("got " + pw); 13.String name = c.readLine("%s", "name: "); 14.System.out.println(" got ", name); If the user types fido when prompted for a password, and then responds bob when prompted for a name,what is the result?()
A

An exception is thrown at runtime

B

pw: fido got fido name: bob got bob

C

pw: got fido name: bob got bob

D

Compilation fails.

参考答案和解析
正确答案: A
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

设有如下的记录类型

Type Student

numberAs string

name As String

age As Integer

End Type

则正确引用该记录类型变量的代码是( )。

A. Student.name="张红"

B. Dim s As Student

s.name="张红"

C. Dim s As Type Student

D. Dim s As Type

s.name="张红" s.Dame="张红"


正确答案:B

第2题:

Helen’s husband is Mark. Mark and Helen have got two children: a son and a daughter. The son’s name is Andrew and the daughter’s name is Joyce. Joyce has got two children, a son and a daughter. So Helen and Mark have got two grandchildren. Helen’s granddaughter’s name is Pam and her grandson’s name is Dan. Andrew isn’t married and he hasn’t got any children. Pam and Dan like playing on the computer with their uncle. Andrew also likes playing football with his brother-in-law, Tom.

1.Andrew is Dan’s uncle. ()

A.Right

B.Wrong

2.Mark is Dan’s father. ()

A.Right

B.Wrong

3.Tom is Dan’s grandfather. ()

A.Right

B.Wrong

4.Joyce is Tom’s wife. ()

A.Right

B.Wrong

5.Pam is Andrew’s niece. ()

A.Right

B.Wrong


正确答案:1.A2.B3.B4.A5.A

第3题:

没有如下的用户定义类型:

Type Student

number As String

name As String

age AS Integer

End Type

则以下正确引用该类型成员的代码是( )。 A.Student. name="李明"

B.Dim s As Student

S. name="李明"

C.Dim s As Type Student

S. name="李明"

D.Dim s As Type

S. name="李明


正确答案:B
 题目中所给出的是用户自定义类型,在这里要注意新类型的名称是 StuDent ,所以选项 C 、 D 均不正确;我们知道对于类型成员的引用是:对象、属性(方法),所以 A 不正确。

第4题:

Giventhatcisareferencetoavalidjava.io.Consoleobject,and:11.Stringpw=c.readPassword("%s","pw:");12.System.out.println("got"+pw);13.Stringname=c.readLine("%s","name:");14.System.out.println("got",name);Iftheusertypesfidowhenpromptedforapassword,andthenrespondsbobwhenpromptedforaname,whatistheresult?()

A.Anexceptionisthrownatruntime

B.pw:fidogotfidoname:bobgotbob

C.pw:gotfidoname:bobgotbob

D.Compilationfails.


参考答案:D

第5题:

Your Web site uses custom Themes. Your Web site must support additional Themes based on the user‘s company name. The company name is set when a user logs on to the Web site. The company‘s Theme name is stored in a variable named ThemeName. You need to use this variable to dynamically set the Web site‘s Theme.What should you do?()

A.

B.

C.

D.


参考答案:C

第6题:

有如下的记录类型

Type student

id As String

name As String

age As Integer

End Type

则正确引用该记录类型变量的代码是( )

A.student.name=”Sias”

B.Dim s As student

s.mane=”Sias”

C.Dim s As type student

s.name=”Sias”

D.Dim s As type

s.name=”Sias”


正确答案:B

第7题:

Tarzan’s name is given by the gorilla mother.()


参考答案:正确

第8题:

( 14 )设有如下的用户定义类型:

Type Student

number As String

name As String

age As Integer

End Type

则以下正确引用该类型成员的代码是

A ) Student.name = " 李明 "

B ) Dim s As Student

s.name = " 李明 "

C ) Dim s As Type Student

s.name = " 李明 "

D ) Dim s As Type

s.name = " 李明 "


正确答案:B

第9题:

Giventhatcisareferencetoavalidjava.io.Consoleobject,whichtwocodefragmentsreadalineoftextfromtheconsole?()

A.Strings=c.readLine();

B.char[]c=c.readLine();

C.Strings=c.readConsole();

D.char[]c=c.readConsole();

E.Strings=c.readLine("%s","name");

F.char[]c=c.readLine("%s","name");


参考答案:A, E

第10题:

下面哪些句子可以表示"您贵姓?"()

A、What's your last name?

B、What's your family name?

C、What's your name?

D、What's your first name?


参考答案:AB

更多相关问题