早教吧 育儿知识 作业答案 考试题库 百科 知识分享

C#选择题9ifyouwanttoopenafilethatexistsorcreateitotherwise,whichofthefollowingisright?a)FileStreamfs=newFileStream(“c:\\myfile.txt”,FileMode.Create,FileAccess.Write);b)FileStreamfs=newF

题目详情
C#选择题
9 if you want to open a file that exists or create it otherwise, which of the following is right?
a)FileStream fs=new FileStream(“c:\\myfile.txt”,FileMode.Create,FileAccess.Write);
b)FileStream fs=new FileStream(“c:\\myfile.txt”,FileMode.CreateNew,FileAccess.Write);
c)FileStream fs=new FileStream(“c:\\myfile.txt”,FileMode.Open,FileAccess.Write);
d)FileStream fs=new FileStream(“c:\\myfile.txt”,FileMode.OpenOrCreate,FileAccess.Write);
10 Identifying what is the relationship between the Television class and Speaker class
a)Inheritance b)Composition c)Utilization d)Instantiation
11 (13) An Event is
a) The result of a users action
b) result of a party
c) code to force users action
d) none of above is true
12 A delegate defines
a) a Wahsington representative
b) a class that encapsulates methods - correct answer
c) a means of passing arrays into methods
d) a substitue for an inherited method
13 (5). An instance method
a) Represents the behavior of an object
b) Represents the attribute of an object
c) Represents another class
d) a and b
14 (28). which statement about delegate is true?
a)Before you declare an event inside a class,you can optionally declare a delegate by using the delegate keyword
b)The delegate type consists of the set of arguments that it receive from the method that handles the event
c)Multiple events cannot share the same delegate
d)By using a single-cast delegate, you can invoke only one method corresponding to different events
15 What is the proper header for a class that intends to use an interface.
a) class MyClass IFace
b) class MyClass ; IFace
c) class MyClass : IFace
d) class MyCalss {IFace}
16 which of the following is true about the ‘not runnable ’state of a thread
a)a sleeping thread enters the ‘not runnable’ state when the specified time has elapsed
b)a thread is in a ‘not runnable’ state if it is dead
c)when the start() method is invoked,the thread enters the ‘not runnable’ state
d)when a thread is blocked by another thread,it enters the ‘not runnable’ state
▼优质解答
答案和解析
9:d
10:b
11:a
12:b
13:a
14:a
15:c
16:d
应该差不多