Quiz 1 C#

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

A

1 What is the base keyword ? [A] The base keyword is used to access members of a base class from within a derived class. [B] The base keyword is used as an operator or as a modifier. [C] The base keyword is used in the definition of a method to support polymorphism. [D] The base keyword is used to modify a method.

A

10 Which class is at the top of.NET class hierarchy? [A] System.Object [B] System.Int32 [C] System.Byte [D] System.String

B

100 Which sentence is correct? [A] Panel controls cannot support scroll bars [B] Panel controls are used to group related controls in a logical unit [C] Panel controls cannot contain other controls [D] Panel controls are not visible at runtime

A

11 What does the keyword "virtual" declare for a method? [A] The method can be overridden. [B] The method cannot be overridden. [C] The method cannot be inherited. [D] The method cannot be accessible.

D

12 Which keyword is used when you wish to explicitly reference the fields and members of the current object? [A] abstract [B] virtual [C] base [D] this

D

13 Which sentence is correct? [A] An abstract class is a class that can be sealed. [B] An abstract class is a class that cannot be inherited from. [C] A class can inherit from many abstract classes. [D] An abstract class is a class that cannot be instantiated.

C

14 Assume that you wish to build a delegate that can point to any method that returns a bool value and takes a string as input parameter. What is correct syntax to declare this delegate? [A] public delegate string Method!(string si) ; [B] public delegate void Method!(string si) ; [C] public delegate boolMethodl(string si) ; [D] public delegate string Method1(boolsi) ;

C

15 What can be signature of an application's entry point? [A] public static void mainO {} [B] public static void Ma in (string s) {} [C] public static void Main() { } [D] public static void Main(int n) {}

C

16 An engine that shared by all .NET-aware languages is called: [A] A shared engine [B] A general engine [C] A common runtime engine [D] A base class engine

D

17 Which of the following statements is true? [A] A class is the implementation of an objec t [B] A class is the instantiation of an objec t [C] An object is the implementation of a class. [D] An object is the instantiation of a class.

C

18 What is default accessibility for the structures in C# ? [A] Protected [B] Private [C] Internal [D] Public

B

19 When is the garbage collector invoked? [A] It's invoked when the managed heap does not have sufficient memory to allocate a requested object [B] It's invoked when the stack does not have sufficient memory to allocate a requested object [C] It s invoked periodically. [D] It is invoked randomly.

D

2 Which of the following can be defined as generic? (Choose one answer) [A] Structures [B] Delegates [C] Methods. Classes. Interfaces [D] All of the others

B

20 Which type of the System. Threading namespace can be used to resolve the issue of concurrency? [A] Timer [B] Monitor [C] Thread [D] ThreadPool

C

21 The DataTable structure is defined by its _ and _. [A] Columns. Rows [B] Rows. Constraints [C] Columns. Constraints [D] Primary keys. Foreign keys

B

22 Which delegate of System.Threading namespace points to any methods that take no argument and returns int? [A] ParameterizedThreadStart [B] System.Threading namespace does not contain this delegate. [C] ThreadStart [D] Thread

B

23 Suppose we have multi-file assembly as follows: lib.dll. parti.netmodule. part2.netmodule. part3.netmodule. Which file is the manifest information located in? [A] In part2.netmodule [B] In lib.dll [C] Each file contains a piece of manifest information [D] In parti.netmodule

A

24 To get values of the columns of the i-th row in a DataTable object named datatable. what of the followings is correct? [A] Object Q array = datatable.Rows[i].ltemArray; [B] DataRow array = datatable. Rows[i].ltemArray; [C] DataColumn array = datatable.Rows[i].ltemArray; [D] StringQ array = datatable.Rows[i].ltemArray;

A

25 Can we connect to SQL Server Database without using SqIConnection? [A] Yes. we can connect to SQL Server Database using OleDbConnection. [B] Yes. we can connect to SQL Server Database using OracleConnection. [C] No. we cannot connect o SQL Server Database without using SqIConnection. [D] Yes. we can connect to SQL Server Database using MySQLConnection.

D

26 Assume you wish show data of Customers table in a DataGridView control. What is the most suitable object to set to the DataSource property? [A] DataSet [B] DataColumn [C] DataTable [D] DataRow

D

27 What is return value of ExecuteNonQueryO method of a Command object? [A] The Command object does not support ExecuteNonQueryO method. [B] An integer represents total rows that are results of SQL command. [C] The ExecuteNonQueryO does not have a return value. [D] An integer is number of affected rows.

A

28 Which sentence about Connection object is correct? [A] Connection object is used to establish a session with the data source. [B] Connection object is used to obtain information from a data source. [C] Connection object is used to execute a SQL command

A

29 You need to get access to a database that is stored on a server running Microsoft SQL Server 2000. Which data adapter would you use? [A] SqIDataAdapter [B] OleDataAdapter [C] ODBCDataAdapter [D] OleDbDataAdapter

C

3 What kind of memory where an object is allocated? [A] Managed heap [B] Data area [C] Stack area [D] Code area

B

30 Which of the statements on Serializable is true? [A] Only collections such as List are Serializable [B] An instance of a type that is Serializable can be easily transmitted over the network, or stored in a file on the file system [C] All objects in .NET are Serializable [D] Being Serializable applies to all types that are stored on the stack, and only to them

B

31 A DataSet object is one of the components of the data provider. [A] TRUE [B] FALSE

A

32 which sentence about background threads is correct? [A] Background threads are viewed by the CLR as expendable paths of execution that can be ignored at any point in time. [B] Background threads have the ability to prevent the current application from terminating. [C] You cannot create any background threads. [D] By default every thread that is created via the Thread StartQ method is automatically a background thread

B

33 An assembly consists of Assembly Metadata. Type Metadata. _ and [A] Type Declaration and Resources [B] IL Code and Resources [C] Resources and Classes [D] Classes and IL Code

A

34 Does NET Framework support to monitor the modification of a given external file? [A] Yes [B] No

D

35 What is state of a thread after creating a Thread object? [A] Stopped [B] Running [C] Started [D] Unstarted

B

36 What is the TrackBar control? [A] The TrackBar control allows user to select to choose an item from a range of possible selections, using a pair of small up and down arrows [B] The TrackBar control allows user to select a value from a range (of values), using scroll bar-like input mechanism. [C] The TrackBar control allows user to input a string value. [D] The TrackBar control allows user to select a range of dates using a friendly Ul

A

37 You are required to build an application that can serialize an object to a file. Then, this file can be transferred to another program written in Java and running in Linux operating system to be de serialized Which of the following classes is the best choice for the above task? [A] SoapFormatter [B] NetworkFormatter [C] BinaryFormatter [D] Formatter

B

38 Which member of System.Threading namespace is an enumeration? [A] ThreadPool [B] ThreadPriority [C] ThreadStart [D] Thread

B

39 Assume you wish show data of Customers table in a DataGridView control. What is the best manner to do it? [A] Use the Connected Layer [B] Use the Disconnected Layer

A

4 Where can you change 'Default Namespace" of Visual Studio? [A] The Application tab of the project's Properties window. [B] The Debug tab of the project's Properties window. [C] The Build tab of the project's Properties window. [D] The Resources tab of the project's Properties window.

A

40 By default can we delete a folder that contains subdirectories and files? [A] No [B] Yes

C

41 You want to add a control to your form that allows you to set a particular option on or off. Which control would you choose? [A] Button [B] ListBox [C] CheckBox [D] CheckedListBox

A

42 The...method of the ...object is used to redirect the user to another page. [A] Redirect, Response [B] Redirect, Request [C] Form.Let, Request [D] Form.Get, Request

B

43 Which sentence about WSDL is correct? [A] WSDL is based on HTML. [B] WSDL is used to describe information about the web service [C] WSDL is executed by the web server. [D] WSDL is executed by the client.

C

44 What is NOT a client-site technology? [A] DHTML [B] JavaScript [C] VB.NET [D] HTML

C

45 How many Page directives an ASP.NET page can include? [A] More than 1 [B] 0 [C] 1

A

46 In ASP.NET application, and ________ variables can be accessed by all the pages in the application. [A] Session, Application [B] Global, Session [C] Server, Session [D] Application, Server

B

47 Assume you wish to check validation of E-mail data. Which validation control is the most suitable to do it? [A] RangeValidator [B] RegularExpressionValidator [C] RequiredFieldValidator [D] CompareValidator

A

48 What is advantage of code-behind page model? [A] It is possible to have designers working on the markup while programmers author the C# code. [B] Pages are easier to deploy or send to another developer. [C] Managing files in a source control system is slightly easier. [D] Pages are easier to rename.

C

49 Which variables can use by all users and in all pages? [A] Session [B] Cookie [C] Application [D] ViewState

C

5 The library provides shelter from the complexities of raw API calls and offers a consistent object model used by all .NET-aware languages. [A] Shared class [B] Root class [C] Base class [D] Common class

A

50 Item stored in ViewState exist for the life of the current page? [A] True [B] False

D

51 What is the lifespan for items stored in ViewState? [A] 2 minutes [B] 2 seconds [C] 20 minutes [D] Exists for the Life of the current page

C

52 he first event to be triggered in an aspx page is ... [A] Render [B] Page_Load [C] Page_Init

A

53 Which of following extension does a Web service file will have? [A] asmx [B] aspx [C] ascx [D] resx

B

54 What does the "EnableViewState" property do? [A] ViewState is used to save your identity. [B] It allows the page to save the users input on a form across postbacks. [C] ViewState is used to ensure the security. [D] ViewState is used to increase the performance.

A

55 How many web.config files an ASP.NET application can have? [A] Only 1. [B] Greater than or equal 1. [C] An ASP.NET application don't have web.config file.

D

56 What are required services in an ASP.NET Web server? [A] Messenger and IIS Admin [B] HTTP SSL and Messenger [C] World Wide Web Publishing and HTTP SSL [D] IIS Admin and World Wide Web Publishing

A

57 Which method is fired lastly during the page load? [A] UnLoad() [B] lnit() [C] PreRender() [D] LoadQ

A

58 We can use ... and ... methods to ensure that application-level variables are not updated by more than one user simultaneously. [A] Block and Unblock [B] Lock and Unlock [C] Server and Session [D] Lock and Key

A

59 Server side code is excuted at the server side on IIS in ASP.NET framework, and client side code is executed on the browser. [A] Yes [B] No

A

6 We CANNOT use methods that have some arguments for a delegate? [A] No [B] Yes [C] Yes. but methods have to only one argument

A & D

60 NET Framework has two main components, are [A] NET Framework class library [B] ADO.NET [C] Windows Forms Application [D] Common Language Runtime

D

61 Presents a logical view of our work using an Explorer-like view of the classes, methods and properties. [A] Solution View [B] Resource View [C] Properties View [D] Class View

B

62 What is managed code? [A] It is the code that cannot be directly hosted by the .NET runtime. [B] It is the code targeting the .NET runtime. [C] It is used to build the Component Object Model (COM). [D] It is written by Visual Basic 6.0.

B

63 Which thing is not included in a .NET PE file? [A] IL [B] Source code [C] Resource file [D] Metadata

B

64 ______are the collection of reusable classes or types [A] Collections [B] Class libraries [C] Namespaces

C

65 What is the name of entity that compiles CIL code into meaningful CPU instructions? [A] Common Language Specification (CLS). [B] Common Type System (CTS). [C] Just-in-time (JIT) compiler. [D] C# compiler.

A

66 What is the output format of the file the C# compiler produces? [A] IL [B] Hex dump [C] Byte code [D] Native Machine Code

A

67 How many times the .NET programs are compiled? [A] 2 [B] 1 [C] Unspecified.

D

68 Which sentence is correct? [A] An assembly is a logical compile-time mechanism. [B] Namespace are runtime entities. [C] Namespace is a physical run-time mechanism. [D] A namespace is a logical compile-time mechanism.

B

69 Under which of the following environments does your programs execution code run? [A] CLS [B] CLR [C] VB.NET [D] MSIL

B

7 Which sentence about enumerations is correct? [A] By default the storage used to hold each item of an enumeration is a floating-point value. [B] Enumerations are a handy programming construct that allow you to group name/value pairs. [C] You cannot alter the storage slot used to hold each item of an enumeration.

A

70 A C# class can be inherited from multi other classes? [A] No [B] Yes

A

71 Which sentence is correct? [A] A delegate must define name of the method on which it makes calls. [B] The method on which a delegate makes calls cannot have any arguments. [C] The method on which a delegate makes calls cannot have return type.

B

72 Which is internal access modifier? [A] Define a member as accessible only by the class. [B] Marks a member as accessible limited to the current assembly, but not outside the assembly. [C] Marks a member as accessible only by the class or any derived classes. [D] Define a member as accessible from an object variable as well as any derived classes.

D

73 Which sentence is correct? [A] You cannot determine total elements of an ArrayList variable. [B] Elements of an ArrayList variable can have different types. [C] You must specify total elements of an ArrayList variable before declaring it. [D] Stack is a first-in, first-out queue.

C

74 Which parameter modifier marks a parameter as passed by value? [A] ref [B] params [C] None [D] Out

B

75 Does destructor of a class impact to garbage collection? [A] No [B] Yes

A

76 Which sentence is correct? [A] An interface is name collection of semantically related abstract member. [B] All interface members are implicitly private. [C] Interfaces can provide an implementation of the methods [D] Interfaces can be used to define state data.

A & B

77 How do we implement encapsulation? (choose 2) [A] Define a pair of accessor and mulator methods. [B] Define a named property [C] Define a destructor [D] Define a contructor.

B

78 Which sentence is correct? [A] Override method does not include override keyword [B] Override method and overridden base method must have the same return type. [C] Override method can change accessibility of overridden base method [D] Override base method can be defined by virtual keyword only.

B

79 Which sentence is correct? [A] You must specify total elements of a List<T> variable before declaring it. [B] Elements of a List<T> variable cannot have different type. [C] You cannot determine total elements of a List<T> variable [D] Type of a List<T> variable is value type only.

A

8 C# language offers the following features (choose a correct answer): [A] No pointers required: Automatic memory management through garbage collection! [B] Pointers required: Full support for aspect-oriented programming (AOP) techniques via attributes [C] Support a "delete" keyword: Full support for aspect-oriented programming (AOP) techniques via attributes [D] No pointers required: Support a "delete" keyword!

A

80 what is boxing? [A] Boxing is conversion form an object to a value type. [B] Boxing is conversion form a string to an object [C] Boxing is conversion form a string to an integer [D] Boxing is conversion form an integer to a string.

A

81 Value types can be null [A] True [B] False

B

82 Which sentence is correct? [A] Shared assemblies are libraries reside in the same directory of application making use of them [B] Shared assemblies are libraries intended to be consumed by numerous application on a single machine. [C] Executable assemblies (*.exe) can be installed into the GAC [D] Private assemblies are deployed to GAC

A

83 Which sentence about background threads is correct? [A] Background threads are viewed by the CLR as expendable paths of execution that can be ignored at any point in time. [B] By default, every thread that is created via the Thread.Start() method is automatically a background thread. [C] You cannot create any background threads [D] Background threads have the ability to prevent the current application from terminating

D

84 Which sentence about strong name is correct? [A] Strong name in only friend name of the assembly [B] Strong name includes no more than 128-bit numbers [C] You must create a strong name when building a private assembly [D] Strong name is used to uniquely identify the publisher of a .NET library.

A

85 can multiple versions of the name .NET assembly be installed on a single machine? [A] Yes [B] No

A

86 a class library that is written by C# can be used in any other .NET programming language [A] True [B] False

A & B

87 What is described in "Win32 process " term? (choose 2) [A] Set of resource, such as external code libraries and the primary thread [B] Necessary memory allocations used by a running application [C] Number of required threads to run the process [D] Necessary CPU's time slot used by a running application

A

88 a given application domain can have only thread executing with it at any given time [A] false [B] true

A

89 a single process may contain multiple application domains [A] true [B] false

C

9 When will the garbage collector run? [A] Once every day at 13.00. [B] Every 15 minutes. [C] When the application is low on memory

A & B

90 Why do we use Thread pool? (choose 2) [A] When using Thread pool, we can focus on our business problem rather than the application's threading infrastructure. [B] The Thread pool manages thread efficiently by minimizing the number of threads that must be created, started and stopped [C] Because the Thread pool are always thread with default priority [D] Because the Thread pool are always background threads.

C

91 which sentence about default context is correct? [A] default context is context1. [B] default context is the last context created within an application domain [C] default context is used to group together .NET objects that have no specific or unique contextual needs. [D] Only default application domain has default context

B

92 can we draw a hexagonal with GDI+? [A] Yes, by using DrawHexagonal method of Graphics object [b] Yes, by using DrawPolygon method of Graphics object [C] NO

D

93 which sentence about the following code is correct? StreamWritersw = new StreamWriter("Text.txt") [A] if file "Text.txt" does not exist, this code will raise an exception [B] if file "Text.txt" exist, this code will append to this file [C] if file "Text.txt" exist, this code will raise an exception [D] if file "Text.txt" does not exist, this code will create a new file

A

94 Which sentence is correct? [A] Object graph is a set of related object of serialized object [B] Object graph isgraph of serialized object [C] A serialized object always has an Object graph [D] Object graph have to map to classic OO relationships

C

95 can we cancel closing a form? [A] Yes, by using FormClosed event [B] No [C] Yes, by using FormClosing event

A

96 What is the first event is raised when the form has been allocated on the managed heap? [A] Load [B] Deactivate [C] Click [D] Activate

D

97 hich event of form handles pressing a key? [A] KeyUp [B] Activated [C] Deactivate [D] KeyDown

B

98 how do we create a control to enter password? [A] Use ComboBox control [B] Use TextBox control with PasswordChar property is set a value [C] Use TextBox control with default properties [D] Use PasswordBox control

A

99 What are states that a CheckBox can have? [A] Checked only [B] Checked, Indeterminate and Unchecked [C] Unchecked only [D] Checked and Unchecked


Ensembles d'études connexes

CompTIA Project + Pre-Assessment

View Set

DoD 8570.01-M (with Change-3), Information Assurance Workforce Improvement Program

View Set

Radical Republicans Challenge Presidential Reconstruction: 1866-1867

View Set

Chapter 17 - Biopsychology of Emotion, Stress, and Health: Fear, The Dark Side of Emotion

View Set

Lippincott's cardiac questions for MedSurg

View Set

15. Tétel: Legyen képes felsorolni az államháztartás alrendszereit

View Set