1. Question: The this reference refers to the instance itself in C#.

    A
    True

    B
    False

    Note: Not available
    1. Report
  2. Question: Which of the following are correct ways to define CurrentPrice property in the class Stock in term of C#?

    A
    public class Stock{ decimal currentPrice; public decimal CurrentPrice{ get{return currentPrice;} set{currentPrice=value;} } }

    B
    public class Stock{ public decimal CurrentPrice{ set;get; } }

    C
    public class Stock{ ; public decimal CurrentPrice{ get(); set(); }

    D
    public class Stock{ decimal currentPrice; public decimal CurrentPrice{ return get; set=value; }

    Note: Not available
    1. Report
  3. Question: Which of the following code fragments are correct syntax for implementing an indexer?

    A
    class Sentence{ string[] words; public string this[int index]{ get{return words[index];} set{words[index]=value;} } }

    B
    class Sentence{ string[] words; public string this[int index,int index2]{ get{return words[index];} set{words[index]=value;} } }

    C
    class Sentence{ public string this[int index,int index2]{ get{return words[index];} set{words[index]=value;} } }

    D
    class Sentence{ string[] words; public string Index[int index]{ get{return words[index];} set{words[index]=value;} } }

    Note: Not available
    1. Report
  4. Question: Which of the following is the correct way to define a constant field in the class in term of C#?

    A
    public const int PI=3.145

    B
    public constant int PI=3.145

    C
    public int const PI=3.145

    D
    const public int PI=3.145

    Note: Not available
    1. Report
  5. Question: A class can be marked as static, and can be subclassed.

    A
    True

    B
    False

    Note: Not available
    1. Report
  6. Question: Static field initializes run just before the static constructor is called.

    A
    True

    B
    False

    Note: Not available
    1. Report
  7. Question: Which of the following is the correct deconstructor or finalizer method declaration in the class definition?

    A
    class MyClass{ ~MyClass(){ } }

    B
    class MyClass{ _MyClass(){ } }

    C
    class MyClass{ Finalize(){ } }

    D
    None

    Note: Not available
    1. Report
  8. Question: Partial methods must be void and are implicitly private.

    A
    True

    B
    False

    Note: Not available
    1. Report
  9. Question: A subclass is also called a derived class and a base class is also called a superclass

    A
    True

    B
    False

    Note: Not available
    1. Report
  10. Question: Which class is called super class as the following code fragment?
    public class Asset{
      public string Name;
    
    }
    
    public class Stock : Asset{
      public long SharesOwned;
    }
    
    public class House : Asset{
      public decimal Mortgage;
    
    }

    A
    Asset

    B
    Stock

    C
    House

    D
    Stock and House

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd