Untitled Deck Flashcards
What is the output of the following code?
```C#
try
{
int x = 20;
int y = x / 5;
Console.WriteLine(“Total: “ + y);
}
finally
{
Console.WriteLine(“ End! “);
}
~~~
Total: 4 End!
This exception is thrown when an unacceptable argument is passed to a method.
ArgumentNullException
This is used to get the size of the stream.
long length
Which of the following statements is true about interface?
An interface can be implemented by multiple classes in the same program.
Assuming the method implementations are correct, what will be displayed by the program below?
```C#
public delegate Val DelValues<Val>(Val arg);
private void btnShow_Click(object sender, EventArgs e)
{
DelValues<string> fullName = new DelValues<string>(Info.GetFullName);
DelValues<int> totalAmount = new DelValues<int>(Compute.GetTotalAmount);
Console.WriteLine(fullName("Paul Cruz"));
Console.WriteLine(totalAmount(230));
}
~~~</int></int></string></string></Val>
Paul Cruz 230
What will be the output of the following program when compiled and executed?
```C#
using System;
public class Number
{
public Number(int number)
{
Console.WriteLine(number);
}
}
public class LocalNumber : Number
{
public LocalNumber(int num1, int num2) : base(num2)
{
Console.WriteLine(num1);
}
public static void Main(string[] args)
{
LocalNumber In1 = new LocalNumber(25, 50);
Console.ReadKey();
}
}
~~~
25 50
Which has a correct syntax of declaring a namespace?
namespace ExampleNamespace;
Which of the following types of stream refers to the objects where the data is written?
Output stream
Which of the following lines of code retrieves a value even if the current stream supports reading or not?
public abstract bool CanRead { get; }
Which of the following codes retrieves the value that the current stream supports reading?
public override bool CanRead { get; }
What property of a stream supports position request and returns true?
bool CanSeek
Which of the following statements is true about the System.Data.Sql
namespace?
It contains new generic interface and classes for SQL Server data access.
What is the output of the following statements when executed?
```C#
StringBuilder word = new StringBuilder(“welcome”);
word[2] = ‘ ‘;
Console.Write(word);
~~~
we come
These primitive types directly store the value to the memory address.
Value types
This syntax can be used to retrieve the value that will determine the current stream timeout.
public virtual bool CanTimeout { get; }