C# Developer Test

40 Questions | Attempts: 149
Share

SettingsSettingsSettings
C Programming Quizzes & Trivia

Welcome!
This is a C# test. The test contains 40 questions and you have 30 minutes to solve them.
Please give us your full name and your e-mail address to be able to identify your answers.
If you are ready to start it, press the Start button!
Good luck!


Questions and Answers
  • 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

    Correct Answer
    B. Is declared within a method
  • 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

    Correct Answer
    B. Represents an attribute of an object
  • 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
    E. A and c
  • 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

    Correct Answer
    A. Represents the behavior of an object
  • 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
    E. All of the above
  • 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

    Correct Answer
    B. Creates the class Test that inherits the class Form
  • 7. 

    A variable declared inside a method is called a________variable

    • A.

      Static

    • B.

      Private

    • C.

      Local

    • D.

      Serial

    • E.

      B and d

    Correct Answer
    C. Local
  • 8. 

    Defining two methods with the same name but with different parameters is called.

    • A.

      Loading

    • B.

      Overloading

    • C.

      Multiplexing

    • D.

      Duplexing

    Correct Answer
    B. Overloading
  • 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

    Correct Answer
    C. Return type
  • 10. 

    In the body of a method, C# uses the variable named_____to refer to the current object whose method is being invoked.

    • A.

      Call

    • B.

      This

    • C.

      Do

    • D.

      That

    Correct Answer
    B. This
  • 11. 

    String mystring; Creates a(n)

    • A.

      Class

    • B.

      Constructor

    • C.

      Object

    • D.

      A and b

    Correct Answer
    C. Object
  • 12. 

    An Event is ...

    • A.

      The result of a users action

    • B.

      Result of a party

    • C.

      Code to force users action

    Correct Answer
    A. The result of a users action
  • 13. 

    A delegate defines ...

    • A.

      A Wahsington representative

    • B.

      A class that encapsulates methods

    • C.

      A means of passing arrays into methods

    • D.

      A substitue for an inherited method

    Correct Answer
    B. A class that encapsulates methods
  • 14. 

    Is it possible to pass methods as arguments for other methods without modification.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 15. 

    All interfaces must contain IDrivable.

    • A.

      All interfaces must contain IDrivable

    • B.

      True

    • C.

      False

    Correct Answer
    C. False
  • 16. 

    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}

    • E.

      Class MyCalss(IFace)

    Correct Answer
    C. Class MyClass : 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
    E. All of the above
  • 18. 

    Every class directly or indirectly extends the______class.

    • A.

      System

    • B.

      Object

    • C.

      Drawing

    • D.

      Console

    Correct Answer
    B. Object
  • 19. 

    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

    • C.

      Have different return types and arguments than the parent class

    • D.

      Are Virtual

    Correct Answer
    B. Maintain the same return type and arguments as the parent class, but implement it differently
  • 20. 

    To output the value of multidimensional array, Console.WriteLines(___)

    • A.

      MyArray[1][3];

    • B.

      MyArray[1.3];

    • C.

      MyArray{1}{3};

    • D.

      MyArray(1),(3);

    Correct Answer
    A. MyArray[1][3];
  • 21. 

    All methods in an abstract base class must be declared abstract.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 22. 

    Methods that are declared abstract in the base class must show implementation at the time of declaration.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 23. 

    The code public class B : A { }

    • 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

    • C.

      Errors

    • D.

      A and b

    Correct Answer
    B. Defines a class that inherits the public and protected methods of A only
  • 24. 

    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

    Correct Answer
    C. One constructor takes an arguments of the type int
  • 25. 

    Classes declared with the sealed keyword cannot be base class.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 26. 

    A method_............_an exception when that method detects that a problem has occured.

    • A.

      Trys

    • B.

      Catches

    • C.

      Throws

    • D.

      A and b

    Correct Answer
    C. Throws
  • 27. 

    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

    Correct Answer
    E. All of the above
  • 28. 

    A  ____  block enclose the code that could throw an exception.

    • A.

      Try

    • B.

      Catch

    • C.

      Exception

    • D.

      Error

    • E.

      A and b

    Correct Answer
    A. Try
  • 29. 

    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

    Correct Answer
    A. An object that allows computer multitasking
  • 30. 

    In C# Thread.Sleep(time) measures time in:

    • A.

      Seconds

    • B.

      Milliseconds

    • C.

      Nanoseconds

    • D.

      All of the above

    Correct Answer
    B. Milliseconds
  • 31. 

    When a thread returns from a WaitSleepJoin or Suspended state it returns to the:

    • A.

      Unstarted state

    • B.

      Stopped state

    • C.

      Started state

    • D.

      Resume state

    Correct Answer
    C. Started state
  • 32. 

    The way of returning a thread from s suspended state is:

    • A.

      Pulse

    • B.

      PulseAll

    • C.

      PulseAll

    • D.

      Resume

    • E.

      ReStart

    Correct Answer
    D. Resume
  • 33. 

    In order to lock/unlock an object use the:

    • A.

      Lock and Unlock methods

    • B.

      Enter and Exit methods

    • C.

      Close and Open methods

    • D.

      Close and Allow methods

    Correct Answer
    B. Enter and Exit methods
  • 34. 

    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
    D. System namespace
  • 35. 

    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

    Correct Answer
    C. Sequence of characters in double quotation marks
  • 36. 

    To create a string literal exclude escape sequence, use:

    • A.

      !string

    • B.

      @string

    • C.

      #string

    • D.

      $string

    Correct Answer
    B. @string
  • 37. 

    String indexers treat strings as:

    • A.

      Binary code

    • B.

      1 to string Length

    • C.

      Arrays of characters

    • D.

      A character

    Correct Answer
    C. Arrays of characters
  • 38. 

    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

    Correct Answer
    B. Searches for the first occurrence of any of the characters in the string
  • 39. 

    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

    Correct Answer
    B. The are two different objects
  • 40. 

    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);

    Correct Answer
    C. String.ToLower();

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Feb 19, 2013
    Quiz Edited by
    ProProfs Editorial Team
  • Jul 03, 2012
    Quiz Created by
    Fastrack
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.