Q 1) MVC Means ?
Ans)
ASP.NET MVC is a part of the ASP.NET Web application framework
MVC application is created by using following 3 attributes namely: Model, View and Controller.
Model: It tells the the core information of an application which includes data, validation rules and data access and aggregation logic.
View: The view is used to encapsulate the presentation of the application.
Controller: The controller contains of the control-flow logic. Controller interacts with the Model and View in order to control the flow and execution of the application.
--------------------------------------------------------------------------------------------------------------------
Q 2) Is it possible to implement an interface to a structure?
Is it possible to extend a struct?
Is it possible to inherit a class to struct?
Is it possible to implement an interface to a structure?
Ans: A struct can implement interfaces, and it does that exactly
as classes do.
Is it possible to extend a struct?
Ans: struct cannot extend another struct
Is it possible to inherit a class to struct?
Ans: A struct cannot inherit from another struct or class
--------------------------------------------------------------------
Q 3) When static constructor is invoked?
A static constructor is used to initialize any static data, or to
perform a Particular action that needs performed once only. It is
called automatically before the first instance is created or any
static members are referenced.
Static constructors have the following properties:
• A static constructor does not take access modifiers or have
parameters.
• A static constructor is called automatically to initialize the class
before the first instance is created or any static members are referenced.
• A static constructor cannot be called directly.
• The user has no control on when the static constructor is executed in the program.
• A typical use of static constructors is when the class is using a log file and the
constructor is used to write entries to this file.
• Static constructors are also useful when creating wrapper classes for unmanaged
code, when the constructor can call the LoadLibrary method.
public class Bus {
// Static constructor:
static Bus()
{
System.Console.WriteLine("The static constructor invoked.");
}
public static void Drive()
{
System.Console.WriteLine("The Drive method invoked.");
}
}
class TestBus {
static void Main()
{ Bus.Drive();
}}
Tags :MVC,Is it possible to implement an interface to a structure,Is it possible to extend a struct,Is it possible to inherit a class to struct,
0 comments: