logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Functions and Subroutines See What Others Are Saying!
  • Question
  • How many values is a subroutine capable of returning?


  • Options
  • A. Depends upon how many params arguments does it use.
  • B. Any number of values.
  • C. Depends upon how many ref arguments does it use.
  • D. 0
  • E. 1

  • Correct Answer



  • More questions

    • 1. The string built using the String class are immutable (unchangeable), whereas, the ones built- using the StringBuilder class are mutable.

    • Options
    • A. True
    • B. False
    • Discuss
    • 2. Which of the following statements are correct?

      1. The signature of an indexer consists of the number and types of its formal parameters.
      2. Indexers are similar to properties except that their accessors take parameters.
      3. Accessors of interface indexers use modifiers.
      4. The type of an indexer and the type of its parameters must be at least as accessible as the indexer itself.
      5. An interface accessor contains a body.

    • Options
    • A. 1, 3, 5
    • B. 1, 2, 4
    • C. 3, 5
    • D. 2, 4
    • Discuss
    • 3. Which of the following is the correct way to implement the interface given below?

      interface IPerson
      { 
          String FirstName
          {
              get;
              set; 
          } 
      }

    • Options
    • A.
      class Employee : IPerson
      {
          private String str; 
          public String FirstName
          {
              get
              { 
                  return str;
              } 
              set
              { 
                  str = value;
              } 
          } 
      }
    • B.
      class Employee
      {
          private String str;
          public String IPerson.FirstName
          { 
              get
              { 
                  return str;
              } 
              set
              { 
                  str = value;
              } 
          } 
      }
    • C.
      class Employee : implements IPerson
      {
          private String str; 
          public String FirstName
          { 
              get
              { 
                  return str;
              } 
              set
              {
                  str = value; 
              } 
          } 
      }
    • D. None of the above
    • Discuss
    • 4. Which of the following are reuse mechanisms available in C#.NET?

      1. Inheritance
      2. Encapsulation
      3. Templates
      4. Containership
      5. Polymorphism

    • Options
    • A. 1, 4
    • B. 1, 3
    • C. 2, 4
    • D. 3, 5
    • Discuss
    • 5. If a base class contains a member function func(), and a derived class does not contain a function with this name, an object of the derived class cannot access func().

    • Options
    • A. True
    • B. False
    • Discuss
    • 6. Which of the following is NOT a namespace in the .NET Framework Class Library?

    • Options
    • A. System.Process
    • B. System.Security
    • C. System.Threading
    • D. System.Drawing
    • E. System.Xml
    • Discuss
    • 7. The this reference gets created when a member function (non-shared) of a class is called.

    • Options
    • A. True
    • B. False
    • Discuss
    • 8. Which of the following statements is correct about Bitwise | operator used in C#.NET?

    • Options
    • A. The | operator can be used to put OFF a bit.
    • B. The | operator can be used to Invert a bit.
    • C. The | operator can be used to check whether a bit is ON.
    • D. The | operator can be used to check whether a bit is OFF.
    • E. The | operator can be used to put ON a bit.
    • Discuss
    • 9. Which of the following statements is correct about the C#.NET code snippet given below?

      int d; 
      d = Convert.ToInt32( !(30 < 20) );

    • Options
    • A. A value 0 will be assigned to d.
    • B. A value 1 will be assigned to d.
    • C. A value -1 will be assigned to d.
    • D. The code reports an error.
    • E. The code snippet will work correctly if ! is replaced by Not.
    • Discuss
    • 10. Which of the following will be the correct output for the C#.NET code snippet given below?

      String s1 = "Nagpur";
      String s2;
      s2 = s1.Insert(6, "Mumbai"); 
      Console.WriteLine(s2);

    • Options
    • A. NagpuMumbair
    • B. Nagpur Mumbai
    • C. Mumbai
    • D. Nagpur
    • E. NagpurMumbai
    • Discuss


    Comments

    There are no comments.

Enter a new Comment