Final C#

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

d

Which of the following is not a C# keyword? Select one: a. private b. delegate c. if d. implements

c

_______ is the conversion a value type into a corresponding reference type by storing the variable in a System.Object Select one: a. Unboxing b. Wrapper c. Boxing d. UnWrapper

c

______class cannot be created using the new keyword and it can contain only static members or fields . Select one: a. public b. internal c. static d. protected

d

A Delegate object ... Select one: a. is created with the new operator. b. is mutable. c. is an instance of a class. d. is static object.

a

We have to following sentences: 1) VBScript is client-side script code which is supported by Internet Explorer only. 2) JavaScript is client-side script code which is supported by all browsers. Select one: a. Sentence 1 is correct, sentence 2 is correct. b. Sentence 1 is correct, sentence 2 is not correct. c. Sentence 1 is not correct, sentence 2 is correct. d. Sentence 1 is not correct, sentence 2 is not correct.

c

What ASP.NET object encapsulates the user's data as it is sent from a form in a page? Select one: a. The Request object. b. The Application object. c. The Response object. d. The Session object.

d

What is a DataTable? Select one: a. A pointer to a remote database. b. Represents one table of in-memory data. c. None of the others. d. All of the others.

d

What is output of the following code: int[]TestArray; TestArray = new int[25]; for (int i = 1; i <= 25; i++) { TestArray [i] = i; } Select one: a. No error, no warning b. No errors, but there is 1 warning. c. Compiler error d. Runtime error

a

What is output when calling CallingMethod() method? public void CallingMethod() { int MyInteger = 7; CalledMethod(out MyInteger); System.Console.WriteLine(MyInteger; } void CalledMethod(out int Integer1) { return; } Select one: a. Compiler error b. Runtime error c. 7

cd

When would you typically use an Input parameter? Select one or more: a. When the parameter value is created based on user input b. When the parameter value is passed to an Insert statement. c. When the command is set to execute a statement with a Where clause. d. When the parameter is used to send data from the application to the database.

a

Which of following event in ASP.NET Web Form is fired when a new user logs on to your application and we can establish any user-specific data points ? Select one: a. Session_Start() b. Application_Start() c. UserLogin_Start() d. Session_Begin()

a

Which of following objects in ASP.NET Web Form provides to maintain stateful information in web applications ? 1.LocalStorage 2.Application 3.Session 4.Cache Select one: a. 1, 2, 3 & 4 b. 1 & 2 c. 2, 3 & 4 d. 2 &

d

Which of the following statements are True ? 1. A class is a definition for a user-defined type (UDT) 2. An object is a given instance of a particular class in memory 3. An object of a class can be created without new keyword Select one: a. 1 , 2 & 3 b. 1 & 3 c. 2 & 3 d. 1 & 2

d

Which of the following statements related to .NET Solution are True? 1. Full interoperability with existing code and complete and total language integration 2.A common runtime engine shared by all .NET-aware languages. 3.A base class library and no more COM plumbing 4.A truly simplified deployment model meaning no need to register a binary unit into the system registry Select one: a. 1, 2 & 3 b. 1, 3 & 4 c. 2, 3 & 4 d. 1 , 2, 3 & 4

c

Which of the following statements related to Assemblies are True ? 1.Assemblies can be divided into 2 types : .exe and .netmodule 2.Private assemblies reside in the same directory as the client application making use of them. 3.Shared assemblies are libraries intended to be consumed by numerous applications on a single machine and are deployed to a specific directory termed the Global Assembly Cache . Select one: a. 1, 2 & 3 b. 1 & 2 c. 2 & 3 d. 1 & 3

d

Which of the following statements related to Base Class Libraries are True? 1. Defines classes available to all .NET Framework languages 2. Defines various primitives: threads, file input/output, graphical rendering, interaction with external hardware devices 3. Support database access, XML manipulation and security Select one: a. 2 & 3 b. 1 & 3 c. 1 & 2 d. 1 , 2 & 3

d

Which of the following statements related to CLR responsibilities are True ? 1.Resolving the location of an assembly and finding the requested type within the binary by reading the contained metadata 2.Loading the type into CPU registry 3.Compiling CIL into platform-specific instruction 4.Performing security checks, executing the code Select one: a. 1 , 2 & 3 b. 1 , 2 , 3 & 4 c. 2 , 3 & 4 d. 1 , 3 & 4

b

Which of the following statements related to Win32 File Header are True ? 1. Establishes the fact that the assembly can be loaded and manipulated by the Windows. 2. Identifies the kind of application : console-based, GUI-based, or *.dll code library to be hosted by the Windows . 3.Includes information to register into the Window registry . Select one: a. 1, 2 & 3 b. 1 & 2 c. 2 & 3 d. 1 & 3

c

Which property of form to get or set the button control that will be clicked when the user presses the Esc key? Select one: a. AbortButton b. EscButton c. CancelButton d. AcceptButton

c

Which sentence about value-based types is correct? Select one: a. Value-based types are classes. b. Value-based types can be null. c. Value-based types contain references to object. d. Value-based types are structures.

d

delegate void D1(); class Program { static void Print() { Console.Write("A"); } static void Show() { Console.Write("B"); } static void Main(string[] args) { D1 d = new D1(Print); d += new D1(Show); d(); } } The output will be Select one: a. A b. BA c. B d. AB

d

ASP.NET ______allow you to create a consistent layout for the pages in web application and it defines the look and feel and standard behavior that we want for all of the pages (or a group of pages) in web application . Select one: a. Themes b. Web parts c. Layout pages d. master pages

InsertCommand.Parameters.Add("@var", type).Value

Assume that: 1. SQL Server database contains a table, Sales, with these columns: SalesID (int, identity) StoreNumber (int) Sales (int) 2. The following stored procedure accepts as inputs the store number and sales, inserts a new row in the table with this information, and returns the new identity value: CREATE PROCEDURE procInsertSales @StoreNumber int, @Sales int, @SalesID int OUTPUT AS INSERT INTO Sales (StoreNumber, Sales) VALUES (@StoreNumber, @Sales) SELECT @SalesID = @@IDENTITY Which statement should you use to define the SqlParameter object for the @SalesID parameter for the previous stored procedure? Select one: a. D b. A c. B d. C

a

C# offers the______ keyword to define variables with a fixed, unalterable value. It is important to understand that the value assigned to a constant variable must be known at ______ time Select one: a. const , compile b. constant, run c. const , run d. constant, compile

c

Hiding the implementation and exposing the interface is a concept of OOP called: Select one: a. Inheritance b. Overloading c. Encapsulation d. Polymorphism

c

Select one: a. This is father b. This is son c. This is father This is son d. This is son This is father

c

Select one: a. string a = "3", b = "4"; Swap(ref a, ref b); b. All of the others c. string a = "3", b = "4"; Swap < string > (ref a, ref b); d. int a = 3, b = 4; Swap(ref a, ref b);

a

Select the reasons why you would use Windows Forms over Web Forms: Select one: a. All of the others. b. You need a consistent graphical interface. c. You need the processing to occur on the client. d. You need access to local resources.

b

The switch expression can be of : Select one: a. int type b. All of the others c. string type d. enum type e. char type

c

Using ________keyword, the registration and un-registration methods as well as any necessary member variable delegate types are done automatically. Select one: a. interface b. class c. event d. override

b

Which of the following entry point for the application does not the C# compiler accept: Select one: a. public static int Main(string [] Arguments) b. None of the others c. public static int Main() d. public static void Main() e. public static void Main(string[] Arguments)

a

Which of the following method of SqlCommand object is used to execute non-query statements into the SQL Server database Select one: a. ExecuteNoneQuery() b. ExecuteUpdateQuery() c. UpdateWithoutQuery() d. ExecuteWithoutQuery()

a

Which of the following object is used to redirect a web page to the another web page ? Select one: a. Session b. Cookie c. Response d. Request

d

Which of the following objects can be data source for the DataGridView in Window Form? 1. DataTable 2. DataSet 3. List 4. String Select one: a. 1 & 4 b. 1, 2 & 3 c. 1, 2, 3 & 4 d. 1 & 2

b

Which of the following properties can change the size of the Form ? 1.Size 2.WindowState 3.MaximizeBox 4.MinimizeBox Select one: a. 1 & 2 b. 1, 2 , 3 & 4 c. 1 , 2 & 3 d. 2 & 3

a

Which of the following provider type to interact with databases is not included in the .NET Framework Select one: a. JDBC b. ODBC c. ADO.NET d. OLEDB

c

Which of the following statement is incorrect? Select one: a. In C#, programmers never explicitly destroy a managed object. b. In C#, protected visibility allows a method to be accessed by the defining class, as well as any derived classes. c. As soon as we define a custom constructor for a class type, the free default constructor is removed. d. In C#, A private class cannot be accessed by other classes.

b

_______defines a subset of common types and programming constructs that all .NET programming languages can agree on in order to interoperate successfully. Select one: a. Common Intermediate Language (CIL) b. Common Language Specification (CLS) c. Common Language Runtime (CLR) d. Common Type System (CTS)

d

______keyword allows having a number of identically typed arguments as a single logical parameter. A method can have only a single params modifier, and it must be the final parameter of the method. Select one: a. out b. readonly c. ref d. params

c

class A { public double Calc(int n,params int[] a) { int s = 0, i; for (i = 0; i < n; i++) s += a[i]; return s/n; } } class Program { static void Main(string[] args) { double s; A obj = new A(); s = obj.Calc(4,2,3,1,4); Console.WriteLine(s); } } The output will be Select one: a. 3.5 b. 1.5 c. 2 d. 2.5

b

class A { public int GetNumber() { return 3; } } class B : A { public void Calc(ref int s) { for (int i = 1; i <= GetNumber(); i++) s += i; } } class Program { static void Main(string[] args) { int s = 0; B obj = new B(); obj.Calc(ref s); Console.WriteLine(--s); } } The output will be Select one: a. 6 b. 5 c. 4 d. 3

d

class A { public void Print() { Console.Write("FUG"); } } class B : A { public void Print() { Console.Write("FU"); } } class Program { static void Main(string[] args) { A obj1 = new B(); obj1.Print(); Console.WriteLine(); } } The output will be Select one: a. FUFUG b. FUGFU c. FU d. FUG

b

class A { static int x = 2; static A() { x++; } public A() { x *= 3; } public void Print() { Console.WriteLine("{0} , {1}", x, ++x); } } class Program { static void Main(string[] args) { A obj = new A(); obj.Print(); } } The output will be Select one: a. 10 , 11 b. 9 , 10 c. 8 , 10 d. 9 , 9

d

class Program { static int GetValue(int a,ref int b) { int c = 0; for (int i = b; i >= a; i--) { if (i % 2 != 0) c *=i; else c += i; } b += c; return c; } static void Main(string[] args) { int a = 1, b = 3, c = 1; c = GetValue(a,ref b); Console.WriteLine("a={0},b={1},c={2}", a, b, c); } } The output will be Select one: a. a=2,b=3,c=4 b. a=2,b=4,c=3 c. a=1,b=6,c=3 d. a=1,b=5,c=2

b

class Program { static void GetValue(ref int a, out int b, int c) { b = a * c; --a; c = a + b; } static void Main(string[] args) { int a = 2, b = 2, c = 4; GetValue(ref c, out b, a); Console.WriteLine("a={0},b={1},c={2}", a, b, c); } } The output will be Select one: a. a=1,b=3,c=8 b. a=2,b=8,c=3 c. a=1,b=8,c=3 d. a=2,b=7,c=4

a

interface IA { int Calc(params int[] a); } class A:IA { public int Calc(params int[] a) { int s = 1, i; for (i = 0; i < a.Length; i++) s *= a[i]; return s; } } class Program { static void Main(string[] args) { int s; IA obj = new A(); s = obj.Calc(2,1,4); Console.WriteLine(++s); } } The output will be Select one: a. 9 b. 10 c. 7 d. 8


Kaugnay na mga set ng pag-aaral

02_04_ Express strong doubt about these negative statements

View Set

Chapter 10: Polar Coordinates; Vectors

View Set

Is there a bank near here?, When are you free?

View Set

Texas Promulgated Contract Forms Ch.2

View Set