We do not guarantee the correctness of all answers. It is user’s responsibility to make sure that the answers are right. Good luck.
Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.
It is available to classes that are within the same assembly and derived from the specified base class.
The data value may not be changed.
Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.
System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
An object qualifies as being called immutable if its value cannot be modified once it has been created. For example, methods that appear to modify a String actually return a new String containing the modification. Developers are modifying strings all the time in their code. This may appear to the developer as mutable - but it is not. What actually happens is your string variable/object has been changed to reference a new string value containing the results of your new string value. For this very reason .NET has the System.Text.StringBuilder class. If you find it necessary to modify the actual contents of a string-like object heavily, such as in a for or foreach loop, use the System.Text.StringBuilder class.
StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created.
NO.
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object.
By calling Sort() and then Reverse() methods.
HashTable.
Yes.
catch{
//Statements on exception
}
No. Once the proper catch block processed, control is transferred to the finally block (if there are any).
Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).
Yes. The keyword “sealed” will prevent the class from being inherited.
Yes. Just leave the class public and make the method sealed.
A class that cannot be instantiated. An abstract class is a class that must be inherited and have the methods overridden. An abstract class is essentially a blueprint for a class without any implementation.
1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.
2. When at least one of the methods in the class is abstract.
Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.
They all must be public, and are therefore public by default.
Yes..NET does support multiple interfaces. (but does not suport fro classess).
It’s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you’re okay.
In an interface class, all methods are abstract - there is no implementation. In an abstract class some methods can be concrete. In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers.
When creating a specialized class only one class can be implemented, but may interfaces can be extended. Also if you are adding new methods to an interface the code will break in the specialized class, unless modify the code in the specialized class. But if you have an abstract class, you can add a virtual method can be added without affecting the specialized class codes.
Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Structs can't have distructor. Another difference is that structs cannot inherit.
Value. The data type of the value parameter is defined by whatever data type the property is declared as.
When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class.
No. The signature of the virtual method must remain the same. (Note: Only the keyword virtual is changed to keyword override)
Different parameter data types, different number of parameters, different order of parameters.
Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.
A delegate object encapsulates a reference to a method.
A delegate that has multiple handlers assigned to it.
Yes.
Single-line comments, multi-line comments, and XML documentation comments.
Compile it with the /doc switch.
CorDBG – command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch. 2. DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR.
In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.
Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.
The tracing dumps can be quite verbose. For applications that are constantly running you run the risk of overloading the machine and the hard drive. Five levels range from None to Verbose, allowing you to fine-tune the tracing activities.
Where is the output of TextWriterTraceListener redirected?.
Attach the aspnet_wp.exe process to the DbgClr debugger.
1. Positive test cases (correct data, correct output). 2. Negative test cases (broken or missing data, proper handling). 3. Exception test cases (exceptions are thrown and caught properly).
Yes. If you are debugging via Visual Studio.NET, just go to Immediate window.
It returns a read-only, forward-only rowset from the data source. A DataReader provides fast access when a forward-only sequential read is needed.
SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix. OLE-DB.NET is a .NET layer on top of the OLE layer, so it’s not as fastest and efficient as SqlServer.NET.
"%"
A transaction must be: 1. Atomic - it is one unit of work and does not dependent on previous and following transactions.
2. Consistent - data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t.
3. Isolated - no transaction sees the intermediate results of the current transaction).
4. Durable - the values persist if the data had been committed even if the system crashes right after.
Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and password).
Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.
The database name to connect to.
Deletes it from the memory.
Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings. The connection string must be identical. Explicitly close connection with the "Close()'.
Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.
An MSI installer, a CAB archive, and XCOPY command.
When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.
System.Globalization and System.Resources.
an Assembly.
As a good rule, you should not call the garbage collector. However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice.
Boxing.
Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.
When you want to inherit (use the functionality of) another class.
Assemblies are the building blocks of the .NET framework.
By default the session state is stored in process. But if can save the session state in windows service or in a database table it is possible to retrieve the data stored in session state.
HttpCachePolicy.
RTTI allows the type of an object to determined during program execution.This test can be used to discover precisely what type of object being reffered to by a base class reference. Another use of RTTI is to test in advance whether cast will succeed.
"is".
"as".
If cast succeeds, then a reference to the type is returned. Otherwose a null reference is returned.
Use "typeof" operator.
System.Type
"System.Reflection.MemberInfo".
The value returned by the invoked method.
It allow to add declarative information to a program. Attributes are not a member of a class, but it species the suplimental information that is attached to an item.
System.Attribute
1. To create an Object from a class.
To Hide a member from a base class in an inherited class.
1. Import directives
2. Automatic release of an object.
Use interfaces for multiple inheritance.
The readonly keyword is different from the const keyword. A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for runtime constants.
const
Yes.
by using the keyword params.
public void displayVals(params int[] intvals)
A strong name includes the name of the assembly, version number, culture identity, and a public key token.
a == b is used to compare the references of two objects.
a.Equals(b) is used to compare two objects .
What is strong-typing versus weak-typing? Which is preferred? Why?
exe file is a excutable file which runs in a seperate process which is managed by OS,where as a dll file is a dynamic link library which can be used in exe files and other dll files.
A process will execute the threads(set of instructions), which may contain multiple threads sometimes. THREAD It contains a group of instructions that a processor has to do.
A Process has its own memory space, runtime enivorment and process ID.A Thread run inside a Process and shares its resources with other threads.
Public delegate return_type delegate_name ([Object obj1][, Object obj2]..);
Constructor*
System.Attribute
Metadata is the information stored in the assembly that describes the type and methods of the assembly and provides other usefull information about the assembly. Assemblies are said to be self describing because of the metadata.
Modules are the constituent piece of assemblies. Standing alone modules can't be executed. They must be combined into assemblies to be useful.
Reflection is a process by which a programme can read it's own metadata 0r metadata from another program.
.NET 2.0 supports partial classes. It is possible to split the definition of a class or a struct, or an interface over two or more source files. Each source file contains a section of the class definition, and all parts are combined when the application is compiled.During compile time, it simply groups all the various partial classes and treats them as a single entity.
Partial class allows a clean separation of business logic and the user interface.
If any of the parts are declared abstract, then the entire type is considered abstract. If any of the parts are declared sealed, then the entire type is considered sealed. If any of the parts declare a base type, then the entire type inherits that class.Partial classes will also make debugging easier, as the code is partitioned into separate files. When working on large projects, spreading a class over separate files allows multiple programmers to work on it simultaneously. To split a class definition, use the keyword modifier partial.
private assemblies are intented to use for many application.
1.)Shared assemblies must have a stron name.Strong names are globaly unique.
2.) Sahred assemblies must protected aganist newer versions trampling over it, and so each version you release must have a new version number
3.) Shared assemblies must placed in the Global Assembly Cache(GAC).
private assemblies are intented to use only for one application.
private and shared assemblies.
The process of loading an assembly into it's application by the assembly resolver is called probing.
Ye, it is
The "is" operator evaluates true, if the expression can safely type cast to type without throwing an exception. The syntax is
expression is type
The "as" operator combines the “is” and cast operator by testing the first to see whether a cast is valid and then completing the castwhen it is. If the cast is not valid the operator returns null The syntax is
expression as type
True.
Generic is a code template that can be applied to use the same code repeatedly. Each time the generic is used, it can be customized for different data types without needing to rewrite any of the internal code. Version 2.0 of the .NET Framework introduces a new namespace viz. System.Collections.Generic, which contains the classes that support Generics.
The params keyword allows you to pass in a variable number of parameters without nessarily explicitly creating the array.
// declare a 4x3 integer array
int[,] rectangularArray = new int[rows, columns];
A jagged array is an array of arrays. It is called jagged because each row need not be the same size as all others, and thus a graphical representation of the arry would not be square. It can be declared as
// declare the jagged array as 4 rows high
int[ ][ ] jaggedArray = new int[4][ ];
An indexer is a C# construct that allows you to access collections contained by class using the [ ] syntax of arrays.
Used in an iterator block to provide a value to the enumerator object or to signal the end of iteration. It takes one of the following forms:
yield return expression;
yield break;
It not possible to create child classes from System.String, because System.String is a sealed class.
System.Text.RegularExpressions
System.Exception
System.ApplicationException
Deligates are referece type used to encapsulate a method with specific signature and return type. The deligate can be used to invoke that encapsulated method.
Regression testing is any type of software testing that seeks to uncover new software bugs, or regressions, in existing functional and non-functional areas of a system after changes, such as enhancements, patches or configuration changes, have been made to them.
A lambda expression is an anonymous function that can contain expressions and statements, and you can use it to create delegates or expression tree types.
Value, and its datatype depends on whatever variable we’re changing.
Place a colon and then the name of the base class. Notice that it’s double-colon in C++.
It is available to any sub-class (a class inheriting this class).
Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.
It is available to classes that are within the same assembly and derived from the specified base class
Object is an instance of the class.
"Private" members are accessible only within the body of the class or the struct in which they are declared.
"public" means the the members of the class is accessible to any methods of classes in any package. There are no restrictions on accessing public members.
A "protected" member is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member.
Internal members are accessible only within files in the same assembly.
"protected internal" meembers are acceessible to methods of the container calss, methods of the class derived from this class and also any class in the same assembly.
private | protectd | internal | protectd internal | public | |
Same Class | Yes | Yes | Yes | Yes | Yes |
Same package Non Sub Class | No | No | Yes | Yes | Yes |
Same Package Inherited class | No | Yes | Yes | Yes | Yes |
Diffrent Package Non Sub Class | No | No | No | No | Yes |
Diffrent Package inherited Class | No | Yes | No | Yes | Yes |
Internal.
private.
public.
ICloneable
"this" keyword reffers to the instance of current object.
Static membersa are associated with the class only. Not with the instance of the class.
No.
Yes.
No.
Yes
No.
When the object is distroyed.
~ Class-Name(){//statements}
Useing passing parameter by reference method.
"public void GetTime(ref int h, ref int m, ref int s){}" and call "t. GetTime(ref int h, ref int m, ref int s)"
Use "out" Key word for the parameter.
A method can be overloaded by using " diffrent number or Types of parameters"
Yes.
"virtual" keyword in methods means this method can be override in inherited class.
"override" keyword in methods means this method is an override version of base class.
"new" keyword in methods means this method is NOT an override version of base class.
No. Once you supplied a constructor class can't call it's default constructor.
No.
abstract method is one without implementation. Thei method is implementing in it's spelized class. A class with an abstract method should be also abstract.
Using keyword sealed.
System.Object
Boxing and un boxing are the value types to be treated as reference types and vice versa.
Polimorphism is a feature that allows one interface for many actions.
[attributes] [access-modifiers] class identifier [ : base class] { class Body}
Accessmodifiers controls the accessibility (scope and visibility) of data methods and class.
[access-modifier] Class-name([arguments]){}
CLR will provide the default constructor.
Numeric --> 0
bool --> false
char --> \0 (null)
enum -->0
reffrence -->null
False.
operator
Struct is a value tye and class is a reference type.
structs dosen't suport inheritance or desctructors.
They are reference type used to encapsulate a method with a specic signature and type.
Encapsulation is the mechanism that binds toughter code and the data it manipulate and keeps both safe from outside inheritance and misuse.
The private methods and data of a class is ONLY accessed by the code that is a member of the class.
Assemblies are the building blocks of .NET Framework applications; An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.
A namespace, on the other hand is a collection of classes. It’s more used for logical organization of your classes. Namespaces are a way of grouping type names and reducing the chance of name collisions.
Every assembly contains an assembly manifest, a set of metadata with information about the assembly. The assembly manifest contains these items:
The assembly name and version
The culture or language the assembly supports (not required in all assemblies)
The public key for any strong name assigned to the assembly (not required in all assemblies)
A list of files in the assembly with hash information
Information on exported types
Information on referenced assemblies
public delegate Return Type Method_Name([[Type var],[Type var]]);
There is NO return type for a constructor.
True.
Yes. Named and Optional Arguments are allowed in c#.
Constructot initilizes an object immediatly upon creation.
Encapsulation, Inheritance, Polimorphism.
public, private, protected, internal, Protectd internal.
Inheritance is the process by which one objects acquires the properties of another object.
No.
the Finalize Method allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.