Application Development & Programming Flashcards
7 cards from real MCTS practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Application Development & Programming flashcards as text
In C#, which keyword is used to prevent a class from being inherited?
Answer: sealed
The 'sealed' keyword prevents a class from being used as a base class for inheritance.
Which ADO.NET object is used to execute a SQL command that returns a single scalar value?
Answer: SqlCommand.ExecuteScalar()
ExecuteScalar() returns the first column of the first row from the result set, ideal for aggregate queries.
What is the purpose of the 'yield return' statement in C#?
Answer: Produces the next value in an iterator without stopping execution
'yield return' pauses execution of an iterator method and returns a value to the caller, resuming on the next iteration.
In ASP.NET Web Forms, which event fires before the Page_Load event?
Answer: Page_PreInit
Page_PreInit fires first in the ASP.NET page lifecycle, before Page_Init, and is used to set master pages and themes dynamically.
Which .NET collection class provides a thread-safe, first-in-first-out data structure?
Answer: ConcurrentQueue
ConcurrentQueue in System.Collections.Concurrent is designed for thread-safe FIFO operations without explicit locking.
What does the 'using' statement in C# ensure when working with managed resources?
Answer: Dispose() is called even if an exception occurs
The 'using' statement guarantees that Dispose() is called on an IDisposable object when the block exits, even if an exception is thrown.
In Visual Basic .NET, which statement is used to handle multiple values of a variable similar to a switch statement?
Answer: Select Case
Select Case in VB.NET evaluates an expression and branches to the matching Case block, equivalent to switch in C#.