Pcs- Programming In C# Test For Aptech

65 Questions | Total Attempts: 1604

SettingsSettingsSettings
Please wait...
C Programming Quizzes & Trivia

C# is here Variable of reference type store the memory address of other variables in a Stack.


Questions and Answers
  • 1. 
    Variables of this data types store actual values.This value stored in a stack.
    • A. 

      Value Type

    • B. 

      Reference Type.

  • 2. 
    Variable of reference type store the memory address of other variables in a Stack.
    • A. 

      True

    • B. 

      False

  • 3. 
    The built-in reference data types are : - 2 choices
    • A. 

      Class

    • B. 

      Object

    • C. 

      Delegate

    • D. 

      Array , Interface

    • E. 

      String

  • 4. 
    XML Comments begin with :
    • A. 

      Three forward slashes

    • B. 

      Three asterisks

    • C. 

      Double slashes

  • 5. 
    Constants are declared for value types rather than for reference types.
    • A. 

      True

    • B. 

      False

  • 6. 
    This statement ensure that no other process or threads running in the computer memory can interfere with the code. ensure security and only work with reference type.
    • A. 

      Selection statement

    • B. 

      Iteration statement

    • C. 

      Jump Statement

    • D. 

      Fixed Statement

    • E. 

      Lock Statement

  • 7. 
    This statement is required to tell the garbage collector not to move that object during execution.
    • A. 

      Jump Statement

    • B. 

      Lock statement

    • C. 

      Fixed Statement

    • D. 

      Check ed and Unchecked Statement

  • 8. 
    Which statements are true?
    • A. 

      The conditional operator works with two operands

    • B. 

      The increment operator works with a single operand

    • C. 

      The bitwise exclusive OR operator compares bits and return 1 if only one of the bits is -1.

    • D. 

      The conditional && operator does not check the seconds expression if the first expression is false

    • E. 

      The compound assignment operators execute from right to left.

  • 9. 
    This typeCasting is carried out automatically by the compiler.
    • A. 

      Explicit

    • B. 

      Implicit

  • 10. 
    The class which provides useful methods to convert any built-in data type to another built-in data type.
    • A. 

      System.Console.Convert

    • B. 

      System.Convert

  • 11. 
    This refers to converting a reference type to a value type.
    • A. 

      Boxing

    • B. 

      UnBoxing

  • 12. 
    This is a process for converting a value type to its reference type. this useful to reduce the overhead on the system during execution.
    • A. 

      UnBoxing

    • B. 

      Boxing

  • 13. 
    This array is a multi-dimensional array and is reference to as an array of arrays.It considers of multiple arrays where the number of elements within each array can be different.
    • A. 

      Rectangular Array.

    • B. 

      Jagged Array.

  • 14. 
    This has improved performance and unequal number of columns.
    • A. 

      Rectangular Array

    • B. 

      Single- dimensional Array

    • C. 

      Jagged Array

    • D. 

      Multi- dimensional Array

  • 15. 
    This has many rows and columns.
    • A. 

      Multi- dimensional Array

    • B. 

      Single- dimensional Array

    • C. 

      Rectangular Array

    • D. 

      Jagged Array

  • 16. 
    This allows you to create arrays using the CreateInstance() method.
    • A. 

      Array

    • B. 

      New

    • C. 

      Array class

  • 17. 
    Method which is used to create Multi- Dimension Array
    • A. 

      Public static Array CreateInstance(type elementType, int length);

    • B. 

      Public static Array CreateArray(type elementType, int length);

    • C. 

      Public static Array CreateInstance(type elementType, int rows, int columns);

  • 18. 
    This is the feature of extracting only the required information from object.It's not show all technical details of object.
    • A. 

      Encapsulation

    • B. 

      Inheritance

    • C. 

      Abstraction

    • D. 

      Polymorphism

  • 19. 
    Details of what a class contains need not be visible to other classes and objects that use it.
    • A. 

      Encapsulation

    • B. 

      Inheritance

    • C. 

      Polymorphism

    • D. 

      Abstraction

  • 20. 
    A method name can be an underscore or the "@" character.
    • A. 

      True

    • B. 

      Fasle

  • 21. 
    This variable is a special type that is accessed without using an Object of a class.
    • A. 

      Public variable

    • B. 

      Protect variable

    • C. 

      Static variable

    • D. 

      Final

  • 22. 
    This acces modifier allows the class members to be accessible within the class as well as within the derived class.
    • A. 

      Internal

    • B. 

      Protected

    • C. 

      Private

  • 23. 
    This access modifier allows the class members to be accessible only within the classes of the same assembly.
    • A. 

      Protected

    • B. 

      Public

    • C. 

      Internal

  • 24. 
    This keyword causes arguments to passed in a method by reference.- 2 choices
    • A. 

      Args

    • B. 

      Ref

    • C. 

      Reg

    • D. 

      This

    • E. 

      Out

  • 25. 
    The keyword is used to resolve conflicts between variables having same names and to pass the current object as a parameter.
    • A. 

      Out

    • B. 

      This

    • C. 

      Ref

  • 26. 
    You cannot use the 'this' keyword with static variables and method.
    • A. 

      True

    • B. 

      False

  • 27. 
    A destructor start with the character '@' before the class name.
    • A. 

      True

    • B. 

      False

  • 28. 
    Which statements are true?- 3 choices
    • A. 

      Destructors cannot be overloaded or inherited

    • B. 

      Destructors can be overloaded but not be inherited

    • C. 

      Destructors cannot be i explicitly invoked

    • D. 

      Destructors cannot specify access modifiers and take parameters

    • E. 

      May be more than two Destructor in a class

  • 29. 
    You can use the 'base' keyword for invoking the static methods of the base class.
    • A. 

      True

    • B. 

      False

  • 30. 
    So as to override  a particular method of base class in the derived class, we need to declare the method of base class using the keyword.
    • A. 

      Override

    • B. 

      Virtual

  • 31. 
    This keyword prevents a class from being inherited by any other class.
    • A. 

      Seales

    • B. 

      Sealed

    • C. 

      Prevents

    • D. 

      Out

    • E. 

      Virtual

  • 32. 
    When implementing an interface in a class, you need to implement all the abstract  methods declared in the interface.
    • A. 

      True

    • B. 

      False

  • 33. 
    Properties cannot be classified as variables but, They can use the ref and out keywords.
    • A. 

      True

    • B. 

      False

  • 34. 
    These  are defined with two accessors or methods, the get and set accessors.
    • A. 

      Properties

    • B. 

      Fields

  • 35. 
    These represent the behavior of an Object.
    • A. 

      Fields

    • B. 

      Properties

    • C. 

      Methods

  • 36. 
    These represent characteristic of an Object. Can not have any parameters. and can be overidden but cannot be Overload.
    • A. 

      Properties

    • B. 

      Methods.

    • C. 

      Fields

  • 37. 
    Some of most Namespaces of System are:- 4 choices
    • A. 

      System.Collections.

    • B. 

      System.Data

    • C. 

      System.namespaces

    • D. 

      System.Io / System.Net

    • E. 

      System.Diagnostics

  • 38. 
    Thsi namespace contains classes and interfaces that define conplex data structure as lists,queues..and dictionaries.
    • A. 

      System.Diagnostics

    • B. 

      System.Io / System.Net

    • C. 

      System.Data

    • D. 

      System.Collections.

    • E. 

      System.Web

  • 39. 
    This namespace contains classes that make up ADO.NET architecture.
    • A. 

      System.Web

    • B. 

      System.Collections.

    • C. 

      System.Diagnostics

    • D. 

      System.Io / System.Net

    • E. 

      System.Data

  • 40. 
    This namespace contains classes that are used to interact with the system processes.
    • A. 

      System.Data

    • B. 

      System.Diagnostics

    • C. 

      System.Io / System.Net

    • D. 

      System.Web

  • 41. 
    This namespace contains classes that enable you to read from and write to data stream and file.
    • A. 

      System.Diagnostics

    • B. 

      System.Web

    • C. 

      System.IO

    • D. 

      System.Net

  • 42. 
    This namespace contains classes that you yo create Web-base applications.
    • A. 

      System.Net

    • B. 

      System.Web

    • C. 

      System.Diagnostics

  • 43. 
    This namespace provides classes and interfaces that allow communication between the browser and the serevr.
    • A. 

      System.Net

    • B. 

      System.Web

    • C. 

      System.Data

  • 44. 
    You can apply access modifier such as public, protected, private .. to namspaces
    • A. 

      True

    • B. 

      False

  • 45. 
    Which declaration is used to declare a property.
    • A. 

      Public string property_Name(int parameter) { // body }

    • B. 

      Public string Property_Name { //body. }

    • C. 

      Public string this[int Property_name] { // body }

    • D. 

      Public delegate Property_Name(typeData parameter1, typeData parameter2);

    • E. 

      Public string property_Name() { //body }

  • 46. 
    Which declaration is used to declare a indexer.
    • A. 

      Public string [int index]() { //body }

    • B. 

      Public string int[int index] { //body }

    • C. 

      Public string this[int index]() { //body }

    • D. 

      Public string this[int index] { //body }

  • 47. 
    Which declaration is used to declare a delegate.
    • A. 

      Public delegates Delagate_Name(int parameter1,int parameter2){}

    • B. 

      Public delegates Delagates_Name(int parameter1,int parameter2);

    • C. 

      Public delegate int Delagates_Name(int parameter1,int parameter2);

    • D. 

      Public delegate float Delagate_Name(int parameter1,int parameter2){}

  • 48. 
    Which data structure can not be declared in a namespace ?
    • A. 

      Abstract

    • B. 

      Interface

    • C. 

      Structure

    • D. 

      Enumeration

    • E. 

      Delegate

  • 49. 
    Namespaces control scopes of a class.
    • A. 

      True

    • B. 

      False

  • 50. 
    These Exception are thrown by the CLR.
    • A. 

      System-level Exceptions

    • B. 

      Application-level Exceptions.

  • 51. 
    Returns the exception instance that caused the current Exception.
    • A. 

      Message

    • B. 

      StrackTrace

    • C. 

      InnerException

  • 52. 
    This exception is thrown when the result of an arithmetic, casting or conversion  operation is to large to be stored in the destination object or variable.
    • A. 

      System.ArithmaticException

    • B. 

      System.InvalidCastException

    • C. 

      System.OverflowException

    • D. 

      System.FormatException

  • 53. 
    Customer exceptions can be used to changed the built-in  exceptions with modified message.
    • A. 

      True

    • B. 

      False

  • 54. 
    Can is Delegate declared within class?
    • A. 

      True

    • B. 

      False

  • 55. 
    Which statements are true?
    • A. 

      Delegates are used ti hide static methods.

    • B. 

      Delegates are declared with a return type that may or may not be the same as the return type of the referenced method.

    • C. 

      Delegates are used to invoke overridden methods.

  • 56. 
    Events can be declared in :- 2 choices
    • A. 

      Classes

    • B. 

      Methods

    • C. 

      Interfaces

    • D. 

      Absract / Sealed

    • E. 

      Delegates

  • 57. 
    Events can be declared as :- 2 choices.
    • A. 

      Classes

    • B. 

      Abstract / Sealed

    • C. 

      Interfaces

    • D. 

      Methods

    • E. 

      Virtual

  • 58. 
    Events are implemented using delegates.
    • A. 

      True

    • B. 

      False

  • 59. 
    Steps for implementing events in C# are:  1. Create the event using the delegate.  2. Subscribe to listen and handle the event.  3. Define a public delegate for the event   4. Raise the event.
    • A. 

      1-2-3-4

    • B. 

      1-3-4-2

    • C. 

      3-1-2-4

    • D. 

      3-1-4-2

  • 60. 
    How to declare Event?
    • A. 

      delegate delegate_name (parameters); event ;

    • B. 

      delegate delegate_name (parameters); event ;

    • C. 

      event ;

  • 61. 
    Which statement are true  for Delegate?
    • A. 

      Public delegate int Add_Dele(int t1, int t2); class Delegate_Event { //public Add_Dele event dele_Event; public int add(int a,int b) { return (a+b); } public void Main(string[] args) { int v1 = 5; int v2 = 10; Add_Dele objDel = new Add_Dele(add); objDel(v1,v2); Console.WriteLine("Value1 + Value2 = " +objDel(v1,v2)); } }

    • B. 

      Public delegate int Add_Dele(int t1, int t2); class Delegate_Event { //public Add_Dele event dele_Event; static int add(int a,int b) { return (a+b); } static void Main(string[] args) { int v1 = 5; int v2 = 10; Add_Dele objDel = new Add_Dele(add); objDel(v1,v2); Console.WriteLine("Value1 + Value2 = " +objDel(v1,v2)); } }

  • 62. 
    Which are true?
    • A. 

      Event can be declared in an Interface.

    • B. 

      Events can are declared as Abstract or Sealed

  • 63. 
    Represents a generic collection consisting of the key and value pairs.
    • A. 

      ICollection

    • B. 

      IDictipnary

    • C. 

      IEnumerator

  • 64. 
    Which statement are true?
    • A. 

      Generics are used to work with multiple data type simultaneously.

    • B. 

      Generics are verified at run-time.

    • C. 

      Generics are declared with or without a type parameter

    • D. 

      Generics can be implemented without a need for explicit or implicit casting.

  • 65. 
    Which are true?- 2 choices
    • A. 

      The get accessor can be executed when the property is assigned a new value

    • B. 

      The get accessor can be declared using a parameter called value.

    • C. 

      The get accessor can be executed by referring to the name of the property.