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.
Questions
To output the value of multidimensional array, Console.WriteLines(___)
- myArray[1][3];
- myArray[1,3];
- myArray{1}{3};
- myArray(1),(3);
All methods in an abstract base class must be declared abstract.
- True
- False
Methods that are declared abstract in the base class must show implementation at the time of declaration.
- True
- False
The code public class B : A { }
- Defines a class that inherits all the methods of A
- Defines a class that inherits the public and protected methods of A only
- Errors
- a and b
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?
- One constructor takes an argument of type i
- There is only a default constructor
- One constructor takes an arguments of the type int
- a and b
A Thread is:
- an object that allows computer multitasking
- an object that wraps itself with other threads
- a deprecated object that is no longer used
Synchronization is:
- the delaying of a thread until there is sufficient memory and work to keep it up
- making every thread start and end at the same time
- make each thread do the same thing
- have each thread start at the same time but not necessarily finish together
- wait until the required resources, that are used by other threads become available
In C# Thread.Sleep(time) measures time in:
- seconds
- milliseconds
- nanoseconds
- all of the above
When a thread returns from a WaitSleepJoin or Suspended state it returns to the:
- Unstarted state
- Stopped state
- Started state (now considering a part of the running state)
- Resume state
The ThreadPriority enumeration does not contain:
- Lowest
- Highest
- BelowNormal
- None of the above
String indexers treat strings as:
- binary code
- 1 to string Length
- arrays of characters
- a character
If an IndexofAny method is passed an array of characters it:
- finds the first occurrence of each letter in the string
- searches for the first occurrence of any of the characters in the string
- will search for the first occurrence of the sequence of characters
- generates an error
Concatenating with strings are done with:
- reserved words
- method calls
- operator overloading
- operator overloading and method calls
If two StringBuilder objects contain the same string then
- they represent the same meory location
- the are two different objects
- if one changes, so will the other
- None of the above
The proper way to convert a string to all lowercase is:
- String = string.ToLower(string);
- ToLower(string);
- string.ToLower();
- string.ToLower(string);