Tải bản đầy đủ (.doc) (10 trang)

Đề thi trắc nghiệm môn c sharp (1)

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (50.25 KB, 10 trang )

Cau 1. A local variable
a. Can be used anywhere in the program
b. Is declared within a method
c. Must accept a class
d. Represent a class object
Cau 2. An instance variable
a. Is an object of a class
b. Represents an attribute of an object
c. Is a method of a class
d. A and C
Cau 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
Cau 4. 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
Cau 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
Cau 6. Class Test: Form{}
a. Creates the class Test: Form
b. Creates the class Test that inherits the class Form
c. Creates the class form that inherits the class Test


d. A and B
Cau 7. A variable declared inside a method is called a …..
a. Static
b. Private
c. Local
d. Serial


e. B and D
Cau 8. Defining two methods with the same name but with different
parameters is called.
a. Loading
b. Overloading
c. Multiplexing
d. Duplexing
Cau 9. Find any errors in the following BankAccount constructor;
Public int BankAccount() { balance = 0;}
a. Name
b. Formal parameters
c. Return type
d. No errors
Cau 10. In the body of a method, C# uses the variable named … to
refer to the current object whose method is being
a. Call
b. This
c. Do
d. That
Cau 11. String mystring; Creates a(n)
a. Class
b. Constructor

c. Object
d. A and B
Cau 12. An Event is
a. The result of a users action
b. Result of a party
c. Code to force users action
Cau 13. A delegate defines
a. A Wahsington representative
b. A class that encapsulates methods
c. A means of passing arrays into methods
d. A substiue for an inherited method
Cau 14. Is it possible to pass methods as arguments for other
a. True
b. False


Cau 15. All interfaces must contain IDrivable
a. True
b. False
Cau 16. What is the proper header for a class that intends to use
a. Class MyClass IFace
b. Class MyClass ; IFace
c. Class MyClass : IFace
d. Class MyClass {IFace}
e. Class MyClass(IFace)
Cau 17. In order for a class to use an interface, it must
a. Inherit the properties of interface
b. Contain the same methods as the interface
c. Create an interface objects
d. A and B

e. All of the above
Cau 18. Every class directly or indirectly extends the …. class.
a. System
b. Object
c. Drawing
d. Console
Cau 19. The concept of composition specifies that you can.
a. Compose good code with C#
b. Compose C# projects with different objects
c. Reduce errors by remaining composed during programming
d. All of the above
Cau 20. Polymorphism occurs when the methods of the child
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
c. Have different return types and arguments than the parent class
d. Are Virtual
Cau 21. Tho output the value of multidimensional array,
Console.WriteLines(___)
a. myArray[1][3];
b. myArray[1,3];
c. myArray{1}{3};


d. myArray(1),(3);
Cau 22. All methods in an abstract base class must be declared
abstract.
a. True
b. False
Cau 23. Methods that are declared abstract in the base class must

show implementation at the time of declaration.
a. True
b. False
Cau 24. The code public class B : A {}
a. Difines a class that inherits all the methods of A
b. Defines a class inherits the public and protected methods of A only
c. Errors
d. A and B
Cau 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
d. A and B
Cau 26. Classes declared with the sealed keyword cannot be base
class
a. True
b. False
Cau 27. A method ….an exception when that method detects that a
problem has occurred.
a. Trys
b. Catches
c. Throws
d. A and B
Cau 28. Exception objects are derived from the class.
a. Try
b. Catch
c. Exception
d. Event



e. System
Cau 29. An abstract class
a. May contain instance variables
b. May contain constructors
c. May extend another class
d. A and B
e. All of the above
Cau 30. A …..block enclose the code that could throw an exception.
a. Try
b. Catch
c. Exception
d. Error
e. A and B
Cau 31. A Thread is:
a. An object that allows computer multitasking
b. An object that wraps itself with other threads
c. A deprecated object that is no longer used
Cau 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
Cau 33. In C# Thread.Sleep(time) measures time in:
a. Seconds

b. Miliseconds
c. Nanoseconds
d. All of the above
Cau 34. When a thread returns from a WaitSleepJoin or Suspended
state it returns to the:
a. Unstarted state
b. Stopped state
c. Started state (now considering a part of the running state)
d. Resume state


Cau 35. The ThreadPriotity enumeration does not contain:
a. Lowest
b. Highest
c. BelowNormal
d. None of the above
Cau 36. The way of returning a thread from s suspended state is:
a. Pulse
b. PulseAll
c. Resume
d. ReStart
Cau 37. In order to lock/unlock an object use the.
a. Lock an Unlock methods
b. Enter and Exit methods
c. Close and Open methods
d. Close and Allow methods
Cau 38. Class String and the Char structure found the:
a. System.Strings namespace
b. System.Text namespace
c. System.Chars namespace

d. System namespace
Cau 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
d. Contains exactly its variable name and nothing else
Cau 40. To create a string literal exclude escape sequence, use:
a. !string
b. @string
c. #string
d. $string
Cau 41. String indexers treat strings as:
a. Binary code
b. 1 to string Length
c. Arrays of characters
d. A character


Cau 42. If an IndexofAny method is passed an array of characters it:
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.
c. Will search for the first occurrence of the sequence of characters.
d. Generates an error
Cau 43. Concatenating with strings are done with:
a. Reserved words
b. Method calls
c. Operator overloading
d. Operator overloading and method calls
Cau 44. If two StringBuilder objects contain the same string then
a. They represent the same meory location

b. The are two different objects
c. If one changes, so will the other
d. None of the above
Cau 45. The proper way to convert a string to all lowercase is:
a. String = string.ToLower(string);
b. ToLower(string);
c. string.ToLower();
d. string.ToLower(string);
ASP.NET
Cau 1. In ASP.NET what does the following return <%
Respone.Write(System.Environment.WorkingSet.ToString())
a. gives the memory working set
b. return Null value
c. Gives Error
d. None of the Above
Cau 2. Which of the following denote page code model in ASP.NET?
a. Single-file
b. Code-bihind
c. Both A and B
d. None of the above
Cau 3. Which of the following denote the web control associated with
Table control function of ASP.NET?
a. DataList
b. ListBox
c. TableRow


d. All the Above
Cau 4. Which of the following denote New Data-bound Controls used
with ASP.NET?

a. GridView
b. FormView
c. SplDataSource
d. Both A and B
e. All the Above
Cau 5. In ASP.NET if you want to allows page developers a way to
specify static connections in a content page then the class used is?
a. WebPartManger
b. ProxyWebPartManger
c. System.Activator
d. None of the Above
Cau 6. On which of the operating system bolow ASP.NET can run?
a. Winsows XP Professional
b. Windows 2000
c. Both A and B
d. None of the Above
Cau 7. There is a requirement as follows:
A client side already has 25 COM objects and if the requirement is to
add a 26th function that must exists only for .NET object without
affecting the existing one how to achieve the above?
a. By CCW
b. By RCW
c. By RCA
d. None of the Above
Cau 8. If a developer of ASP.NET defines style information in a
common location. Then that location is called as?
a. Master Page
b. Theme
c. Customization
d. None of the Above

Cau 9. In ASP.NET if one uses Windows authentication the current
request attaches an object called as?
a. Serialization
b. WindowsPrincipal


c. WindowDatset
d. None of the Above
Cau 10. Forms based authentication is otherwise called in ASP.NET
as Cookie Authentication because Forms authentication uses cookies
to allow applications to track users throughout their visit?
a. Cookie Authentication
b. Passport Authentication
c. Windows Authentication
d. None of the Above
Cau 11. Which of the following is true about session in ASP.NET?
a. ASP.NET automatically delete sessions after configurable timeout
interval
b. Programmers has to take care of detete sessions after configurable
timeout interval
c. The default time interval is 5 minutes
d. None of the Above
Cau 12. What model does ASP.NET request processing is based on?
a. Pipeline
b. Waterfall
c. Top-down
d. Bottom-up
Cau 13. To set page title dynamically in ASP.NET which of the
following is used?
a. < head > section

b. < tail > section
c. < sheet > section
d. None of the above
Cau 14. In ASP.NET page framework an automatic way to associate
page events and methods is?
a. AutoEventWireup attribute of the Page directive is set to true
b. AutoEventWireup attribute of the Page directive is set to False
c. It is not possible to set automatically page events and methods
d. None of the Above
Cau 15. In ASP.NET if one wants to set the focus on a particular
control?
a. Call SETFOCUS
b. Call SETCONTROL


c. Call FOCUS method
d. None of the above
Cau 16. A developer wanted to achieve graphics in his display using
ASP.NET. which of the following web controls are available in
ASP.NET to achieve the above?
a. AdRotator
b. LinkButton
c. Both A and B
d. None of the Above
Cau 17. Which of the following denote value that can be taken by
Cache-Control of ASP.NET?
a. Public
b. Private
c. No-cache
d. All the Above




×