• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

DotNet Interview Questions Answers

Question - 121 : - Explain the importance and use of each, Version, Culture and PublicKeyToken for an assembly.

Answer - 121 : -   This three alongwith name of the assembly provide a strong name or fully qualified name to the assembly. When a assebly is referenced with all three. PublicKeyToken: Each assembly can have a public key embedded in its manifest that identifies the developer. This ensures that once the assembly ships, no one can modify the code or other resources contained in the assembly. Culture: Specifies which culture the assembly supports   Version: The version number of the assembly.It is of the following form major.minor.build.revision. Explain the differences between public, protected, private and internal. These all are access modifier and they governs the access level. They can be applied to class, methods, fields. Public: Allows class, methods, fields to be accessible from anywhere i.e. within and outside an assembly. Private: When applied to field and method allows to be accessible within a class. Protected: Similar to private but can be accessed by members of derived class also. Internal: They are public within the assembly i.e. they can be accessed by anyone within an assembly but outside assembly they are not visible.

Question - 122 : - What is the difference between an EXE and a DLL?

Answer - 122 : - You can create an objects of Dll but not of the EXE. Dll is an In-Process Component whereas EXE is an OUt-Process Component.Exe is for single use whereas you can use Dll for multiple use. Exe can be started as standalone where dll cannot be.

Question - 123 : - Creating a Key Pair?

Answer - 123 : - You can create a key pair using the Strong Name tool (Sn.exe). Key pair files usually have an .snk extension. To create a key pair At the command prompt, type the following command: sn k In this command, file name is the name of the output file containing the key pair. The following example creates a key pair called sgKey.snk. sn -k sgKey.snk

Question - 124 : - What are remotable objects in .NET Remoting?

Answer - 124 : - Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.

Question - 125 : -   What is the property available to check if the page posted or not?

Answer - 125 : -   The Page_Load event handler in the page checks for IsPostBack property value, to ascertain whether the page is posted. The Page.IsPostBack gets a value indicating whether the page is being loaded in response to the client postback, or it is for the first time. The value of Page.IsPostBack is True, if the page is being loaded in response to the client postback; while its value is False, when the page is loaded for the first time. The Page.IsPostBack property facilitates execution of certain routine in Page_Load, only once (for e.g. in Page load, we need to set default value in controls, when page is loaded for the first time. On post back, we check for true value for IsPostback value and then invoke server-side code to update data).

Question - 126 : - What is the difference between VB and VB.NET?

Answer - 126 : - Now VB.NET is object-oriented language. The following are some of the differences: Data Type Changes The .NET platform provides Common Type System to all the supported languages. This means that all the languages must support the same data types as enforced by common language runtime. This eliminates data type incompatibilities between various languages. For example on the 32-bit Windows platform, the integer data type takes 4 bytes in languages like C++ whereas in VB it takes 2 bytes. Following are the main changes related to data types in VB.NET: . Under .NET the integer data type in VB.NET is also 4 bytes in size. . VB.NET has no currency data type. Instead it provides decimal as a replacement. . VB.NET introduces a new data type called Char. The char data type takes 2 bytes and can store Unicode characters. . VB.NET do not have Variant data type. To achieve a result similar to variant type you can use Object data type. (Since every thing in .NET including primitive data types is an object, a variable of object type can point to any data type). . In VB.NET there is no concept of fixed length strings. . In VB6 we used the Type keyword to declare our user-defined structures. VB.NET introduces the structure keyword for the same purpose. Declaring Variables Consider this simple example in VB6: Dim x,y as integer In this example VB6 will consider x as variant and y as integer, which is somewhat odd behavior. VB.NET corrects this problem, creating both x and y as integers. Furthermore, VB.NET allows you to assign initial values to the variables in the declaration statement itself: br> Dim str1 as string = Hello VB.NET also introduces Read-Only variables. Unlike constants Read-Only variables can be declared without initialization but once you assign a value to it, it cannot be changes. Initialization here Dim readonly x as integer In later code X=100 Now x can’t be changed X=200 *********** Error ********** Property Syntax In VB.NET, we anymore don't have separate declarations for Get and Set/Let. Now, everything is done in a single property declaration. This can be better explained by the following example. Public [ReadOnly | WriteOnly] P

Question - 127 : - What is smart navigation?

Answer - 127 : - The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

Question - 128 : -   What is encapsulation ?

Answer - 128 : -   Encapsulation is the ability to hide the internal workings of an object's behavior and its data. For instance, let's say you have a object named Bike and this object has a method named start(). When you create an instance of a Bike object and call its start() method you are not worried about what happens to accomplish this, you just want to make sure the state of the bike is changed to 'running' afterwards. This kind of behavior hiding is encapsulation and it makes programming much easier.

Question - 129 : - How is .NET able to support multiple languages?

Answer - 129 : - A language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.

Question - 130 : - What is "Microsoft Intermediate Language" (MSIL)?

Answer - 130 : - A .NET programming language (C#, VB.NET, J# etc.) does not compile into executable code; instead it compiles into an intermediate code called Microsoft Intermediate Language (MSIL). As a programmer one need not worry about the syntax of MSIL - since our source code in automatically converted to MSIL. The MSIL code is then send to the CLR (Common Language Runtime) that converts the code to machine language, which is, then run on the host machine. MSIL is similar to Java Byte code. MSIL is the CPU-independent instruction set into which .NET Framework programs are compiled. It contains instructions for loading, storing, initializing, and calling methods on objects. Combined with metadata and the common type system, MSIL allows for true cross- language integration Prior to execution, MSIL is converted to machine code. It is not interpreted.

Computer Contributors

krishan
Rajeev Katiyar
Yes Baroda

Share your email for latest updates

Name:
Email:

Our partners