Question 1

What is up-casting and down-casting?

 

Question 2:

What is the difference between "is" and "as" when down-casting an object?

Question 3

Assume you are given a class Student below

public class Student

{

            private string stuID;

            private string stuName;

            private int grade;

}

Please provide a mutator of grade which is used to change the grade. If the input grade is less than 0 or greater than 100, no change is made.

Question 4

What is polymorphism?

Question 6

Please write down the results of the following code segments.

String str1 = "aaa";

String str2 = "AAA";

Console.WriteLine(str1.Equals(str2));

 

 

    • 11 years ago
    A+ Answers
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      sk13098.doc