O GoConqr está de visual novo! Conte para nós o que você achou.

Quiz

C# - Test Drive...!!

Prashant Singh R 20 perguntas 5,0 (1 avaliação)

Fazer o quiz

Este quiz tem tempo limite, por isso abre no player de sempre.

Perguntas do quiz (20)

  1. 1What must be different between two overloads of a method?
    1. AEITHER the number of parameters OR the return type of each method overload
    2. BThe names of the method overloads
    3. CEITHER the number of parameters OR the type of at least one parameter
    4. DEITHER the number of parameters OR the type of at least one parameter OR the return type of each method overload
    5. EEITHER the names of the method overloads OR their return types
  2. 2Which operator would you use to attach a handler to an event?
    1. A=
    2. B=+
    3. C+=
    4. D=>
    5. E->
  3. 3Which of the following is a syntactically correct way to declare and initialize an array of "int"?
    1. Avar x = new int[]{1, 2, 3};
    2. Bint[] x = int[] {1, 2, 3};
    3. Cint[3] x = new int{1, 2, 3};
    4. Dvar x = new {1, 2, 3};
  4. 4Consider this implementation of an enumerator.
    If this is enumerated, at what point will the message "In finally block!" be written to the console?
    Imagem da pergunta 4
    1. AIt won't, the yield return bypasses the finally block.
    2. BOnce, after the first item in the enumeration has been returned.
    3. CThree times, once after returning each item in the enumeration.
    4. DOnce, after the enumeration is complete.
  5. 5Name an advantage of passing a parameter to a method by reference, compared to passing by value
    1. APassing by reference protects the data in the caller from inadvertant changes to the parameter value inside the called method.
    2. BIf the method throws an exception, passing by reference preserves more information in the stack trace.
    3. CIf the parameter is large, passing by reference saves data copying and can therefore be quicker.
    4. DPassing by reference allows the method to safely execute on multiple threads simultaneously without risk of corrupting the data in the parameter.
  6. 6In the following code, [System.Web.Services.WebMethod] is an example of which C# language feature?Imagem da pergunta 6
    1. AFunctional Property
    2. BWebMethod
    3. CAttribute
    4. DMethod-Setting
  7. 7What is the main problem with the following code?Imagem da pergunta 7
    1. AThe variable "ex" has been declared twice in the same context.
    2. BThe variable "ex" is not used in the last catch block.
    3. COnly one "catch" block can be associated with each "try" block.
    4. DThe last "catch" block is unreachable.
  8. 8Write the following LINQ query using method syntax.Imagem da pergunta 8
    1. Avar shortNames = names.Where(name => name.Length < 4)
      .OrderBy(name => name);
    2. Bvar shortNames = names.Where(name.Length < 4)
      .OrderBy(x);
    3. Cvar shortNames = names.Where(this.Length < 4)
      .OrderBy(this);
    4. Dvar shortNames = names.Where(this.Length < 4)
      .OrderBy(this)
      .Select(this);
  9. 9What is the full name of the "type" that is represented by keyword "long"?
    1. ASystem.Int64
    2. BSystem.Long64
    3. CSystem.Int
    4. DSystem.Int32
    5. ESystem.Long
  10. 10What does the "params" keyword do when used in a method parameter list?
    1. AGuides the compiler in which overload of a method to choose
    2. BAllows arguments of any type to be passed to a method
    3. CAllows individual arguments to be omitted, with default values supplied, when calling the method
    4. DAllows a variable number of arguments to be used when a method is called

Informações

Descrição
A small test drive - to evaluate a few important concepts from C#
Idioma
English
Visualizações
251
Avaliação
5,0 de 5 · 1 avaliação
Avalie este quiz
Avalie este quiz

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?