How can you prevent a class from overriding in C# and Visual Basic?
Correct Answer
You can prevent a class from overriding in C# by using the sealed keyword; whereas, the NotInheritable keyword is used to prevent a class from overriding in Visual Basic
Technology problems
Search Results
1. What is the syntax to inherit from a class in C#?
Correct Answer: When a class is derived from another class, then the members of the base class become the members of the derived class The access modifier used while accessing members of the base class specifies the access status of the base class members inside the derived class The syntax to inherit a class from another class in C# is as follows: class MyNewClass : MyBaseclass
Correct Answer: NET does not support multiple inheritance directly because in NET, a class cannot inherit from more than one class NET supports multiple inheritance through interfaces
3. In which namespace, all .NET collection classes are contained?
Correct Answer: NET Framework provides enormous advantages to software developers in comparison to the advantages provided by other platforms Microsoft has united various modern as well as existing technologies of software development in NET Framework These technologies are used by developers to develop highly efficient applications for modern as well as future business needs The following are the key components of NET Framework: => NET Framework Class Library => Common Language Runtime => Dynamic Language Runtimes (DLR) => Application Domains => Runtime Host => Common Type System => Metadata and Self-Describing Components => Cross-Language Interoperability => NET Framework Security => Profiling => Side-by-Side Execution
Correct Answer: NET Framework is a complete environment that allows developers to develop, run, and deploy the following applications: => Console applications => Windows Forms applications => Windows Presentation Foundation (WPF) applications => Web applications (ASPNET applications) => Web services => Windows services => Service-oriented applications using Windows Communication Foundation (WCF) => Workflow-enabled applications using Windows Workflow Foundation (WF)
Correct Answer: ADONET is a very important feature of NET Framework, which is used to work with data that is stored in structured data sources, such as databases and XML files The following are some of the important features of ADONET: => Contains a number of classes that provide you with various methods and attributes to manage the communication between your application and data source => Enables you to access different data sources, such as Microsoft SQL Server, and XML, as per your requirements => Provides a rich set of features, such as connection and commands that can be used to develop robust and highly efficient data services in NET applications => Provides various data providers that are specific to databases produced by various vendors For example, ADONET has a separate provider to access data from Oracle databases; whereas, another provider is used to access data from SQL databases
7. What are the usages of the Command object in ADO.NET?
Correct Answer: The following are the usages of the Command object in AD0NET: The Command object in AD0NET executes a command against the database and retrieves a DataReader or DataSet object => It also executes the INSERT, UPDATE, or DELETE command against the database => All the command objects are derived from the DbCommand class => The command object is represented by two classes: SqlCommand and OleDbCommand => The Command object provides three methods to execute commands on the database: => The ExecuteNonQuery() method executes the commands and does not return any value => The ExecuteScalar() method returns a single value from a database query => The ExecuteReader() method returns a result set by using the DataReader object
8. What are the usages of the Command object in ADO.NET?
Correct Answer: The following are the usages of the Command object in AD0NET: The Command object in AD0NET executes a command against the database and retrieves a DataReader or DataSet object => It also executes the INSERT, UPDATE, or DELETE command against the database => All the command objects are derived from the DbCommand class => The command object is represented by two classes: SqlCommand and OleDbCommand => The Command object provides three methods to execute commands on the database: => The ExecuteNonQuery() method executes the commands and does not return any value => The ExecuteScalar() method returns a single value from a database query => The ExecuteReader() method returns a result set by using the DataReader object
Correct Answer: DLR is a runtime environment that allows you to integrate dynamic languages with the Common Language Runtime (CLR) by adding a set of services, such as expression trees, call site caching, and dynamic object interoperability to the CLR The SystemDynamic and SystemRuntimeCompilerServices namespaces are used to hold the classes for DLR It also provides dynamic features to statically-typed languages, such as C# and Visual Basic to enable their interoperation with dynamic languages
Correct Answer: ASPNET is a specification developed by Microsoft to create dynamic Web applications, Web sites, and Web services It is a part of NET Framework You can create ASPNET applications in most of the NET compatible languages, such as Visual Basic, C#, and J# The ASPNET compiles the Web pages and provides much better performance than scripting languages, such as VBScript The Web Forms support to create powerful forms-based Web pages You can use ASPNET Web server controls to create interactive Web applications With the help of Web server controls, you can easily create a Web application