C# Programming Fundamentals: Arrays, OOP, Threading & Strings

Test your knowledge of core C# programming concepts including multidimensional arrays, object-oriented programming (inheritance, abstract classes), multithreading basics, and string manipulation methods.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

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

  1. myArray[1][3];
  2. myArray[1,3];
  3. myArray{1}{3};
  4. myArray(1),(3);
Question 2 Multiple Choice (Single Answer)

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

  1. True
  2. False
Question 3 Multiple Choice (Single Answer)

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

  1. True
  2. False
Question 4 Multiple Choice (Single Answer)

The code public class B : A { }

  1. Defines a class that inherits all the methods of A
  2. Defines a class that inherits the public and protected methods of A only
  3. Errors
  4. a and b
Question 5 Multiple Choice (Single Answer)

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?

  1. One constructor takes an argument of type i
  2. There is only a default constructor
  3. One constructor takes an arguments of the type int
  4. a and b
Question 6 Multiple Choice (Single Answer)

A Thread is:

  1. an object that allows computer multitasking
  2. an object that wraps itself with other threads
  3. a deprecated object that is no longer used
Question 7 Multiple Choice (Single Answer)

Synchronization is:

  1. the delaying of a thread until there is sufficient memory and work to keep it up
  2. making every thread start and end at the same time
  3. make each thread do the same thing
  4. have each thread start at the same time but not necessarily finish together
  5. wait until the required resources, that are used by other threads become available
Question 8 Multiple Choice (Single Answer)

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

  1. seconds
  2. milliseconds
  3. nanoseconds
  4. all of the above
Question 9 Multiple Choice (Single Answer)

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

  1. Unstarted state
  2. Stopped state
  3. Started state (now considering a part of the running state)
  4. Resume state
Question 10 Multiple Choice (Single Answer)

The ThreadPriority enumeration does not contain:

  1. Lowest
  2. Highest
  3. BelowNormal
  4. None of the above
Question 11 Multiple Choice (Single Answer)

String indexers treat strings as:

  1. binary code
  2. 1 to string Length
  3. arrays of characters
  4. a character
Question 12 Multiple Choice (Single Answer)

If an IndexofAny method is passed an array of characters it:

  1. finds the first occurrence of each letter in the string
  2. searches for the first occurrence of any of the characters in the string
  3. will search for the first occurrence of the sequence of characters
  4. generates an error
Question 13 Multiple Choice (Single Answer)

Concatenating with strings are done with:

  1. reserved words
  2. method calls
  3. operator overloading
  4. operator overloading and method calls
Question 14 Multiple Choice (Single Answer)

If two StringBuilder objects contain the same string then

  1. they represent the same meory location
  2. the are two different objects
  3. if one changes, so will the other
  4. None of the above
Question 15 Multiple Choice (Single Answer)

The proper way to convert a string to all lowercase is:

  1. String = string.ToLower(string);
  2. ToLower(string);
  3. string.ToLower();
  4. string.ToLower(string);