C# & ASP - Net Quiz With Result
C# & ASP - Net Quiz With Result
a) Can be used anywhere in the program b) Is declared within a method - correct answer c) Must accept a class d) Represent a class object
2) An instance variable
a) is an object of a class b) represents an attribute of an object - correct answer c) is a method of a class d) a and c
3) Private Button print = new button();
a) creates a button control b) initializes a button control c) instantiates button control d) a and b e) a and c - correct answer
4) An instance method
a) Represents the behavior of an object - correct answer b) Represents the attribute of an object c) Represents another class d) a and b
5) A Constructor
a) is used to create objects b) must have the same name as the class it is declared within c) maybe overloaded d) b and c e) all of the above - correct answer
6) class Test: Form { }
a) Creates the class Test : Form b) Creates the class Test that inherits the class Form - correct answer c) Creates the class form that inherits the class Test d) a and b
7) A variable declared inside a method is called a________variable
a) The result of a users action - correct answer b) result of a party c) code to force users action
13) 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
14) Is it possible to pass methods as arguments for other methods without modification.
a) class MyClass IFace b) class MyClass ; IFace c) class MyClass : IFace - correct answer d) class MyCalss {IFace}
e) class MyCalss(IFace)
17) In order for a class to use an interface, it must
a) inherit the properties of the interface b) contain the same methods as the interface c) create an interface objects d) a and b e) all of the above - correct answer
18) Every class directly or indirectly extends the______class.
a) Compose good code with C# b) Compose C# projects with different objects - correct answer d) Reduce errors by remaining composed during programming e) all of the above
20) Polymorphism occurs when the methods of the child class.
a) Override the parent class methods but maintain the implementation b) Maintain the same return type and arguments as the parent class, but implement it differently - correct answer c) Have different return types and arguments than the parent class d) Are Virtual
21) To output the value of multidimensional array, Console.WriteLines(___)
a) Defines a class that inherits all the methods of A b) Defines a class that inherits the public and protected methods of A only correct answer c) Errors d) a and b
25) Assuming that public class B : A { public B(int i) :base(i) { } } compiles and runs correctly, what can we conclude about the constructors in the class A?
a) One constructor takes an argument of type i b) There is only a default constructor c) One constructor takes an arguments of the type int - correct answer d) a and b
26) Classes declared with the sealed keyword cannot be base class.
a) may contain instance variables b) may contain constructors c) may extend another class d) a and b e) all of the above - correct answer
30) A____block enclose the code that could throw an exception.
a) an object that allows computer multitasking - correct answer b) an object that wraps itself with other threads c) a deprecated object that is no longer used
32) Synchronization is:
a) the delaying of a thread until there is sufficient memory and work to keep it up b) making every thread start and end at the same time c) make each thread do the same thing d) have each thread start at the same time but not necessarily finish together
e) wait until the required resources, that are used by other threads become available - correct answer
33) In C# Thread.Sleep(time) measures time in:
a) Unstarted state b) Stopped state c) Started state (now considering a part of the running state) - correct answer d) Resume state
35) The ThreadPriority enumeration does not contain:
a) Lock and Unlock methods b) Enter and Exit methods - correct answer c) Close and Open methods d) Close and Allow methods
38) Class String and the Char structure found in the:
a) System.Strings namespace b) System.Text namespace c) System.Chars namespace d) System namespace - correct answer
39) A String literal is a:
a) only contains one character b) contains numbers rather than letters c) sequence of characters in double quotation marks - correct answer d) contains exactly its variable name and nothing else
40) To create a string literal exclude escape sequence, use:
c) #string d) $string
41) String indexers treat strings as:
a) finds the first occurrence of each letter in the string b) searches for the first occurrence of any of the characters in the string correct answer c) will search for the first occurrence of the sequence of characters d) generates an error
43) Concatenating with strings are done with:
a) reserved words b) method calls c) operator overloading d) operator overloading and method calls - correct answer
44) If two StringBuilder objects contain the same string then
a) they represent the same meory location b) the are two different objects - correct answer c) if one changes, so will the other d) None of the above
45) The proper way to convert a string to all lowercase is:
3) The Asp.net server control, which provides an alternative way of displaying text on web page, is
a) < asp:label > - correct answer b) < asp:listitem > c) < asp:button >
4) The first event to be triggered in an aspx page is.
a) Add Tag prefix, Tag name b) Add Source, Tag prefix c) Add Src, Tagprefix, Tagname - correct answer
9) Which of the following is true?
a) User controls are displayed correctly in the Visual Studio .NET Designer b) Custom controls are displayed correctly in VS.Net Designer - correct answer c) User and Custom controls are displayed correctly in the Visual Studio .NET Designer.
10) To add a custom control to a Web form we have to register with.
a) TagPrefix b) Name space of the dll that is referenced c) Assemblyname d) All of the above - correct answer
11) Custom Controls are derived from which of the classes
b) Scripting is separated from the HTML, Code is compiled as a DLL, the DLLs can be executed on server - correct answer c) Code is separated from the HTML and interpreted Code is interpreted separately
13) What's the difference between Response.Write() andResponse.Output.Write()?
a) Response.Output.Write() allows you to flush output b) Response.Output.Write() allows you to buffer output c) Response.Output.Write() allows you to write formatted output - correct answer d) Response.Output.Write() allows you to stream output
14) Why is Global.asax is used?
a) Implement application and session level events - correct answer b) Declare Global variables c) No use
15) There can be more than 1 machine.config file in a system
a) IsPostBack is a method of System.UI.Web.Page class b) IsPostBack is a method of System.Web.UI.Page class c) IsPostBack is a readonly property of System.Web.UI.Page class - correct answer
18) The number of forms that can be added to a aspx page is.
a) Session Objects b) Application Objects c) Viewstate d) All of the above - correct answer
20) Which property of the session object is used to set the local identifier?
a) ExecuteReader b) ExecuteScalar
SQL ADVANCED
1) What will be the output of the following statement? SELECT LEN(CAST(LEFT('026-100', 3) AS INT))
a) 1900-01-01 00:00:00.000 b) 1899-01-01 00:00:00.000 c) 1752-01-01 00:00:00.000 d) The system will generate an error. Only positive integer values can be converted to a SMALLDATETIME data type. - correct answer
3) What will be the output of the following statement? SELECT ROUND(123.89, -1)
a) sysobjects
10
a) The public role captures all default permissions for users in a database. b) The public role cannot be dropped. c) The public role is contained in every database, including msdb, tempdb, model, and all user databases except in the master database for security purposes. correct answer d) The public role cannot have users, groups, or roles assigned to it.
10) What is the maximum date value that can be stored in a SMALLDATETIME data type?
a) June 6, 2079 - correct answer b) July 6, 2079 c) December 31, 2079 d) December 31, 9999
11