logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Constructors See What Others Are Saying!
  • Question
  • What will be the output of the C#.NET code snippet given below?

    namespace CuriousTabConsoleApplication
    {
        class Sample
        { 
            public static void fun1()
            { 
                Console.WriteLine("CuriousTab1 method");
            }
            public void fun2()
            { 
                fun1(); 
                Console.WriteLine("CuriousTab2 method");
            }
            public void fun2(int i)
            { 
                Console.WriteLine(i);
                fun2(); 
            } 
        } 
        class MyProgram
        { 
            static void Main(string[ ] args)
            { 
                Sample s = new Sample(); 
                Sample.fun1(); 
                s.fun2(123);
            } 
        } 
    }


  • Options
  • A.
    Tab1 method 
    123
    Tabl method 
    Tab2 method
  • B.
    Tab1 method 
    123
    Tab2 method
  • C.
    Tab2 method 
    123
    Tab2 method 
    Tabl method
  • D.
    Tabl method
    123
  • E.
    Tab2 method 
    123
    Tabl method

  • Correct Answer
  • Tab1 method 
    123
    Tabl method 
    Tab2 method
     


  • More questions

    • 1. Which of the following assemblies can be stored in Global Assembly Cache?

    • Options
    • A. Private Assemblies
    • B. Friend Assemblies
    • C. Shared Assemblies
    • D. Public Assemblies
    • E. Protected Assemblies
    • Discuss
    • 2. Which of the following statements are correct?

      1. A struct can contain properties.
      2. A struct can contain constructors.
      3. A struct can contain protected data members.
      4. A struct cannot contain methods.
      5. A struct cannot contain constants.

    • Options
    • A. 1, 2
    • B. 3, 4
    • C. 1, 2, 4
    • D. 3, 5
    • Discuss
    • 3. Which of the following is the correct size of a Decimal datatype?

    • Options
    • A. 8 Bytes
    • B. 4 Bytes
    • C. 10 Bytes
    • D. 16 Bytes
    • E. None of the above.
    • Discuss
    • 4. Which of the following statements are correct about inspecting an attribute in C#.NET?

      1. An attribute can be inspected at link-time.
      2. An attribute can be inspected at compile-time.
      3. An attribute can be inspected at run-time.
      4. An attribute can be inspected at design-time.

    • Options
    • A. 1, 2
    • B. 3, 4
    • C. 1, 3, 4
    • D. All of the above
    • E. None of the above
    • Discuss
    • 5. In C#.NET if we do not catch the exception thrown at runtime then which of the following will catch it?

    • Options
    • A. Compiler
    • B. CLR
    • C. Linker
    • D. Loader
    • E. Operating system
    • Discuss
    • 6. Which of the folowing does an indexer allow to index in the same way as an array?

      1. A class
      2. A property
      3. A struct
      4. A function
      5. An interface

    • Options
    • A. 1, 3, 5
    • B. 2, 4
    • C. 3, 5
    • D. 3, 4, 5
    • Discuss
    • 7. Which of the following is NOT an Assignment operator in C#.NET?

    • Options
    • A. \=
    • B. /=
    • C. *=
    • D. +=
    • E. %=
    • Discuss
    • 8. 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
    • 9. Creating empty structures is allowed in C#.NET.

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

    • Options
    • A. True
    • B. False
    • Discuss


    Comments

    There are no comments.

Enter a new Comment