C#
What component of .NET Framework provides an extensible set of classes that can be used by any .NET compliant programming language?
.NET Class Libraries
What compiler switch allows you to create an xml file from the xml comments in the files in an assembly?
/doc
What operator represents a conditional operation in c#?
??
What is Explicit Operator (Explicit Casting)?
A (Manual) cast of a larger type to a smaller type. double -> float -> long -> int -> char
What is boxing?
Boxing allows .NET to convert a value type to a reference type.
How are Classes passed?
By Reference
By default, structs are passed how?
By Value
What ways can a method be overloaded in C#
By different parameter data types By Different order of parameters By different number of parameters
What security features are used in .NET Applications?
Code Access Security and Role Based Security
Which pre processor directive allows creating a compound conditional directive?
Elif
Which pre processor directive specifies the end of a conditional directive?
Endif
What is a derived class?
Is a class that is created or derived from another existing class. The existing class from which the derived class gets created through inheritance is known as a base class.
What is Threading?
It is a process of creating applications that can perform multiple tasks independently.
What are some Read only Variable features?
It is allocated at compile time Declaration and initialization are separated It is ran at runtime
What is an Enum
It is used to define constants. C# enumerations are value data types. Enumerations contain its own values and cannot inherit or pass inheritance it is declared using the enum keyword
What is true about CLR?
It provides a language-neutral development and execution environment. It ensures that an application would not be able to access memory that it is not authorized to access. It provides services to run managed applications. The Resources are Garbage collected.
Are private class-level variables able to be inherited?
Yes, and they are accessable
Is it possible to change the value of a variable while debugging?
Yes, within the intermediate window
What is happening in this example? public class TsqlQuery: ITsqlQuery { }
You are implementing an interface and inheriting from a class.
What is a delegate c#
a delegate is a strongly typed function pointer. a reference type variable that holds the reference to a method
What is the Global Assembly Cache?
is a folder in windows directories to store the .NET assemblies that are specificaly designated to be shared by all application executed on a system.
What are Pre-Processor Directives in C#?
tell the compiler to process the given information before actual compilation of the program starts.
What namespace do exceptions come from?
using system.exception;
What is the difference beteween Convert.To32 and Int.Parse
Int.Parse cannot handle null values, it will throw an argument null exception error
Int keyword targets System._______
Int32
How do you create a Two Dimensional Array?
Int[10,5] array;
What is the wild card character in sql?
%
What operator returns the address of a variable in C#?
&
What creates a pointer in C#?
*
How many Web.Config files can there be in a project?
2
What is a base class?
A base class is a class that is used to create or derive other classes. A base class does not inherit from any other class and is the parent of the derived class.
If a method is marked as protected internal, who can access it?
A class within the same assembly, and classes derived from the declaring class.
What is a constructor
A constructor is a special method that is used to create an object out of a class definition.
What is a Short?
A data type that will store numbers ranging from -32,768 to 32,768.
Automatic paging is possible in
A datatable
A variable declared inside a method is called
A local variable
What is Shadowing?
A method or function of the base class that is available to the child(derived class) without the use of the "overriding" keyword. The compiler hides this function or method of the base class. what keyword triggers shadowing? New ex. HelperClass helper = new HelperClass();
What class is underneath a sorted list class?
A sorted HashTable
What is a value type?
A value type is a class whose state may be passed between a client and remote service as a method parameter or return value.
What does an interface and abstract method have in common?
All methods inside the interface are an abstract method
What is Implicit Operator (Implicit Casting)?
An (Automatic) way to convert a smaller type to a larger type. char -> int -> long -> float -> double
What is an abstract class?
An abstract class is a class that cannot be instantiated. The purpose is to create a blueprint for derived classes and set some rules from what the derived classes must implement.
What is a Satellite Assembly?
An assembly containing localized resources for another assembly
What object is used to help you maintain data across users?
Application Object
An _____________ is a collection of files that appear to the programmer to be a single DLL or EXE
Assembly
Managed methods are marked as ______ in MSIL Code
CIL (Common Interface Language)
What constitutes the .NET Framework
CLR Framework Class Library
What is CLR?
Common Language Runtime: the virtual machine component of Microsoft's .NET framework and is responsible for managing the execution of .NET programs. In a process known as just-in-time (JIT) compilation, the CLR compiles the intermediate language code known as Common Intermediate Language (CIL) into the machine instructions that in turn are executed by the computer's CPU. The CLR provides additional services including memory management, type safety and exception handling. All programs written for the .NET framework, regardless of programming language, are executed by the CLR. It provides exception handling, garbage collection and thread management.
What is the difference between Convert.To and Parse
Convert.To can handle null data types, parse will throw a null error
What is the default access modifier for a Class in C#?
Default access modifier of class is Internal. And private for class member
What does the dispose methods do with a connection object
Deletes it from memory
When doing an update in sql, which method of the SqlCommand is best to use?
ExecuteNonQuery
Which Method would you invoke while using the SQLDataAdapter object to load your dataset with data?
Fill
What is an action not performed by the Garbage Collector
Freeing the memory on the stack, closing unclosed db connections, closing unclosed files
What is a feature of a local variable
IT must be declared within a method.
What types of polymorphism exist?
Inheritance based - you have a common base class Interface based - you have a common interface between classes.
Which pre processor directive allows you to modify the compilers line number and optionally the filename output for errors and warnings?
Line
_____________ is code that targets the Common Language Runtime
Managed Code
What is a correct statement about managed code?
Managed code is code that is written to target the services of the CLR
What is method overloading?
Method overloading happens when you have two methods of the same name with but with different number of parameters. It is an example of polymorphism.
What is Overriding?
Method overriding is a feature of OOP that allows us to re-write a base class function or method with a different definition.
Which of the following utilities can be used to compile managed assemblies into a processor-specific native code?
NGEN
Does C# support multiple inheritance
NO
Can a constructor be used to set default values and limit instantiation
No
Can an Abstract class and a Sealed class be inherited?
No
Can an interface be instantiated directly?
No
Does C# use a copy constructor?
No
Can you override Private Virtual Methods?
No, you can't declare private virtual methods, butr you can override protected virtual methods.
What are examples of valid .NET CLR JIT performance counters?
Number of methods that failed to compile with the standard JIT. Percentage of processor time spent performing JIT compilation.
What type of method helps returning more than one value
Output Parameter
When Two methods are the named the same, but have different parameters, what is this called?
Overloading
What is a null coalescing operator?
The null coalescing operator is used with the nullable type values and reference types. It is used for converting an operand to the type of another nullable or not, value type operand where implicit conversion is possible If the value of the first operand is null, then the operator returns the value of the seconds operand, otherwise it returns the value of the first operand.
What are the types of Access Modifiers?
Public - Type or member that can be accessed by any other code in the same assembly or another assembly that references it. Private - The type or member can be accessed only by code in the same class or struct. Protected - Type or member can be accessed by any code in the same class, or in a class that is derived from that class. Internal - type or member that can be accessed by any code in the same assembly, but not from another assembly. Protected Internal - Type or member can be accessed by any code in the assembly in which its declared, or from within a derived class in another assembly.
Is a string a value or reference type?
Reference type. Object, dynamic and string are reference types.
What type of class cannot be inherited?
Sealed Class
What property is used to process different server paths in a page?
Server
What object is used to help you maintain data for a single user
Session Object
How do you kill a users session explicitly?
Session.Abandon
What assembly can be stored in the Global Assembly Cache?
Shared Assemblies
_____________ encapsulates discrete units of functionality and provides a graphical representation of that functionality to the user
System.Controls
What is the root level of the .NET type hierarchy?
System.Object
Is The following true about the .NET framework? It provides different programming models for Windows-Based Applications and web-based applications? It provides an event driven programming model for building Windows Device Drivers
TRUE
What does the keyword Virtual declare for a method or property?
The method or property can be overridden.
What is true about structs?
They have methods, fields, indexers, properties operator methods and events. Structs can have defined constructors, but not destructors. You cannot define a default constructor for a struct. The default constructor is automatically defined and cannot be changed
What does Instantiated mean?
To create a new instance of a class
How do you convert a type to a byte value?
ToByte();
Which data type converts a type to an unsigned big type in c#?
ToUInt64
An Assignment operators cannot be overloaded
True
An event has no return type as a default value
True
Are .NET Assemblies the smallest deployable unit, Only have one entry point (main(), WinMain() or DLLMain()), and can be shared as a shared or private assembly?
True
Can we use reserved keywords as identifiers in c# by prefixing them to the @ character?
True
Function overloading is a kind of static polymorphism?
True
True or False: An enumerated type is declared using the enum keyword. C# enumerations are value data types Enumeration contains its own values and cannot inherit or cannot pass inheritance
True
True or False: Does dynamic types in C# allow you to store any type of value in the dynamic data type variable, and takes place at runtime?
True
True or False: The .NET Framework uses DCOM for making transition between managed and unmanaged code
True
True or False: To Initialize a value is to set the value when it is declared?
True
What is the implicit name of the parameter that gets passed into the set method/property of a class?
Value
What data types are there in C#
Value Types: bool byte sbyte char decimal double float int uint nint nuint long ulong short ushort Reference Types: object string dynamic
A master page is merged with a content page_________ in the page execution life cycle
Very Early
What file contains configuration dat for each unique URI resource used in projects?
Web.Config