logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Constructors See What Others Are Saying!
  • Question
  • Is it possible for you to prevent an object from being created by using zero argument constructor?


  • Options
  • A. Yes
  • B. No

  • Correct Answer
  • Yes 


  • More questions

    • 1. Which of the following is NOT an Assignment operator in C#.NET?

    • Options
    • A. \=
    • B. /=
    • C. *=
    • D. +=
    • E. %=
    • Discuss
    • 2. How many values is a function capable of returning?

    • Options
    • A. 1
    • B. 0
    • C. Depends upon how many params arguments does it use.
    • D. Any number of values.
    • E. Depends upon how many ref arguments does it use.
    • Discuss
    • 3. Creating empty structures is allowed in C#.NET.

    • Options
    • A. True
    • B. False
    • Discuss
    • 4. It is illegal to make objects of one class as members of another class.

    • Options
    • A. True
    • B. False
    • Discuss
    • 5. All code inside finally block is guaranteed to execute irrespective of whether an exception occurs in the protected block or not.

    • Options
    • A. True
    • B. False
    • Discuss
    • 6. Which of the following ways to create an object of the Sample class given below will work correctly?

      class Sample
      {
          int i;
          Single j;
          double k;
          public Sample (int ii, Single jj, double kk)
          {
              i = ii;
              j = jj;
              k = kk;
          } 
      }

    • Options
    • A. Sample s1 = new Sample();
    • B. Sample s1 = new Sample(10);
    • C. Sample s2 = new Sample(10, 1.2f);
    • D. Sample s3 = new Sample(10, 1.2f, 2.4);
    • E. Sample s1 = new Sample(, , 2.5);
    • Discuss
    • 7. Which of the following will be the correct output for the C#.NET program given below?

      namespace CuriousTabConsoleApplication
      { 
          class SampleProgram
          {
              static void Main(string[] args)
              { 
                  int num = 1;
                  funcv(num); 
                  Console.Write(num + ", "); 
                  funcr(ref num); 
                  Console.Write(num + ", ");
              }
              static void funcv(int num)
              { 
                  num = num + 10; Console.Write(num + ", ");
              }
              static void funcr (ref int num)
              { 
                  num = num + 10; Console.Write(num + ", ");
              } 
          } 
      }

    • Options
    • A. 1, 1, 1, 1,
    • B. 11, 1, 11, 11,
    • C. 11, 11, 11, 11,
    • D. 11, 11, 21, 11,
    • E. 11, 11, 21, 21,
    • Discuss
    • 8. Which of the following operators cannot be overloaded?

      1. true
      2. false
      3. new
      4. ~
      5. sizeof

    • Options
    • A. 1, 3
    • B. 2, 4
    • C. 3, 5
    • D. All of the above
    • Discuss
    • 9. Which of the following is the correct output for the C#.NET program given below?

      int i = 20 ;
      for( ; ; )
      {
          Console.Write(i + " "); 
          if (i >= -10)
              i -= 4; 
          else 
              break;
      }

    • Options
    • A. 20 16 12 84 0 -4 -8
    • B. 20 16 12 8 4 0
    • C. 20 16 12 8 4 0 -4 -8 -12
    • D. 16 12 8 4 0
    • E. 16 8 0 -8
    • Discuss
    • 10. In an inheritance chain which of the following members of base class are accessible to the derived class members?

      1. static
      2. protected
      3. private
      4. shared
      5. public

    • Options
    • A. 1, 3
    • B. 2, 5
    • C. 3, 4
    • D. 4, 5
    • Discuss


    Comments

    There are no comments.

Enter a new Comment