logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Attributes See What Others Are Saying!
  • Question
  • 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

  • Correct Answer
  • 1, 2 


  • More questions

    • 1. Which one of the following classes are present System.Collections.Generic namespace?

      1. Stack
      2. Tree
      3. SortedDictionary
      4. SortedArray

    • Options
    • A. 1 and 2 only
    • B. 2 and 4 only
    • C. 1 and 3 only
    • D. All of the above
    • E. None of the above
    • Discuss
    • 2. Which of the following statements are correct about JIT?

      1. JIT compiler compiles instructions into machine code at run time.
      2. The code compiler by the JIT compiler runs under CLR.
      3. The instructions compiled by JIT compilers are written in native code.
      4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.
      5. The method is JIT compiled even if it is not called

    • Options
    • A. 1, 2, 3
    • B. 2, 4
    • C. 3, 4, 5
    • D. 1, 2
    • Discuss
    • 3. Which of the following can be used to terminate a while loop and transfer control outside the loop?

      1. exit while
      2. continue
      3. exit statement
      4. break
      5. goto

    • Options
    • A. 1, 3
    • B. 2, 4
    • C. 3, 5
    • D. 4, 5
    • E. None of these
    • Discuss
    • 4. Which of the following statements are correct about functions used in C#.NET?

      1. Function definitions cannot be nested.
      2. Functions can be called recursively.
      3. If we do not return a value from a function then a value -1 gets returned.
      4. To return the control from middle of a function exit function should be used.
      5. Function calls can be nested.

    • Options
    • A. 1, 2, 5
    • B. 2, 3, 5
    • C. 2, 3
    • D. 4, 5
    • E. None of these
    • Discuss
    • 5. An enum that is declared inside a class, struct, namespace or interface is treated as public.

    • Options
    • A. True
    • B. False
    • Discuss
    • 6. Which of the following are NOT Relational operators in C#.NET?

      1. >=
      2. !=
      3. Not
      4. <=
      5. <>=

    • Options
    • A. 1, 3
    • B. 2, 4
    • C. 3, 5
    • D. 4, 5
    • E. None of these
    • Discuss
    • 7. If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references?

    • Options
    • A. s1 is s2
    • B. s1 = s2
    • C. s1 == s2
    • D. strcmp(s1, s2)
    • E. s1.Equals(s2)
    • Discuss
    • 8. Which of the following is the correct output of the C#.NET code snippet given below?

          int[ , , ] a = new int[ 3, 2, 3 ]; 
          Console.WriteLine(a.Length);

    • Options
    • A. 20
    • B. 4
    • C. 18
    • D. 10
    • E. 5
    • Discuss
    • 9. What will be the output of the code snippet given below?

      int i;
      for(i = 0; i<=10; i++)
      {
          if(i == 4)
          {
              Console.Write(i + " "); continue;
          }
          else if (i != 4)
              Console.Write(i + " "); else
          break;
      }

    • Options
    • A. 1 2 3 4 5 6 7 8 9 10
    • B. 1 2 3 4
    • C. 0 1 2 3 4 5 6 7 8 9 10
    • D. 4 5 6 7 8 9 10
    • E. 4
    • Discuss
    • 10. Which of the following statements are correct about a namespace used in C#.NET?

      1. Classes must belong to a namespace, whereas structures need not.
      2. Every class, struct, enum, delegate and interlace has to belong to some or the other namespace.
      3. All elements of the namespace have to belong to one file.
      4. If not mentioned, a namespace takes the name of the current project.
      5. The namespace should be imported to be able to use the elements in it.

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


    Comments

    There are no comments.

Enter a new Comment