Question 16
You have a stack that contains integer values. The values are pushed onto the stack in the following order:
2,4,6,8.
The following sequence of operations is executed:
Pop
Push 3
Pop
Push 4
Push 6
Push 7
Pop
Pop
Pop
What is the value of the top element after these operations are executed?
Question 17
You have a Microsoft ASP.NET web application.
You need to store a value that can be shared across users on the server.
Which type of state management should you use?
Question 18
You execute the following code.
What will the variable result be?
Question 19
Hotspot Question
You have a base class named Tree with a friend property named color and a protected property named NumberOfLeaves.
In the same project, you also have a class named Person.
For each of the following statements, select Yes if the statement is true.
Otherwise, select No. Each correct selection is worth one point.
Question 20
You are creating a new class named Sphere derived from the Shape class.
The Shape class has the following code:
class Shape
{
public virtual void Area()
{
// additional code...
}
}
The Area method in the Shape class should provide new functionality but also hide the Shape class implementation of the Area method.
Which code segment should you use to accomplish this?

