You are reviewing the following code that saves uploaded images.
Answer :
Explanation:
Which type of function can a derived class override?
Answer : C
Explanation: You can override virtual functions defined in a base class from the Visual
Studio.
The override modifier is required to extend or modify the abstract or virtual implementation of an inherited method, property, indexer, or event.
The Dog class and the Cat class inherit from the Animal class. The Animal class includes a breathe() method and a speak() method. If the speak() method is called from an object of type Dog, the result is a bark. If the speak() method is called from an object of type Cat, the result is a meow.
Which term is used to describe this object-oriented concept?
Answer : A
Explanation: Polymorphism is often referred to as the third pillar of object-oriented programming, after encapsulation and inheritance. Polymorphism is a Greek word that means "many-shaped" and it has two distinct aspects:
* At run time, objects of a derived class may be treated as objects of a base class in places such as method parameters and collections or arrays. When this occurs, the object's declared type is no longer identical to its run-time type.
* Base classes may define and implement virtual methods, and derived classes can override them, which means they provide their own definition and implementation. At run- time, when client code calls the method, the CLR looks up the run-time type of the object, and invokes that override of the virtual method. Thus in your source code you can call a method on a base class, and cause a derived class's version of the method to be executed.
You have a class named Glass that inherits from a base class named Window. The
Window class includes a protected method named break().
How should you call the Glass class implementation of the break() method?
Answer : A
Simulating the final design of an application in order to ensure that the development is progressing as expected is referred to as:
Answer : C
You are creating an application that presents users with a graphical interface. Users will run this application from remote computers. Some of the remote computers do not have the
. NET Framework installed. Users do not have permissions to install software.
Which type of application should you choose?
Answer : C
You are creating the necessary variables for an application. The data you will store in these variables has the following characteristics:
-> Consists of numbers
-> Includes numbers that have decimal points
-> Requires more than seven digits of precision
You need to use a data type that will minimize the amount of memory that is used.
Which data type should you use?
Answer : B
Explanation: The double keyword signifies a simple type that stores 64-bit floating-point values.
Precision: 15-16 digits -
Incorrect:
Not D: The float keyword signifies a simple type that stores 32-bit floating-point values.
Precision: 7 digits -
The elements of an array must be accessed by:
Answer : C
You are designing a class for an application. You need to restrict the availability of the member variable accessCount to the base class and to any classes that are derived from the base class.
Which access modifier should you use?
Answer : C
You need to allow a consumer of a class to modify a private data member.
What should you do?
Answer : C
Explanation: In this example (see below), the Employee class contains two private data members, name and salary. As private members, they cannot be accessed except by member methods. Public methods named GetName and Salary are added to allow controlled access to the private members. The name member is accessed by way of a public method, and the salary member is accessed by way of a public read-only property.
Note: The private keyword is a member access modifier. Private access is the least permissive access level. Private members are accessible only within the body of the class or the struct in which they are declared
Example:
class Employee2
{
private string name = "FirstName, LastName";
private double salary = 100.0;
public string GetName()
{
return name;
}
public double Salary
{
get { return salary; }
}
}
How should you configure an application to consume a Web service?
Answer : B
Explanation: Start by adding a Service Reference to the project. Right-click the
ConsoleApplication1 project and choose Add Service Reference:
This question requires that you evaluate the underlined text to determine if it is correct.
Arguments are passed to console applications as a Hashtable object.
Select the correct answer if the underlined text does not make the statement correct. Select
"No change is needed'' if the underlined text makes the statement correct.
Answer : B
Explanation: Arguments are passed to console applications as a String Array object.
Your database administrators will not allow you to write SQL code in your application.
How should you retrieve data in your application?
Answer : C
Explanation: The SQL will only be inside the stored procedure.
You create an object of type ANumber. The class is defined as follows.
Answer : C
A table named Student has columns named ID, Name, and Age. An index has been created on the ID column. What advantage does this index provide?
Answer : B
Explanation: Faster to access an index table.