Microsoft 98-361 Exam Practice Questions (P. 2)
- Full Access (163 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #6
A class named Manager is derived from a parent class named Employee. The Manager class includes characteristics that are unique to managers.
Which term is used to describe this object-oriented concept?
Which term is used to describe this object-oriented concept?
- AEncapsulation
- BData modeling
- CInheritance
- DData hiding
Correct Answer:
C
Classes (but not structs) support the concept of inheritance. A class that derives from another class (the base class) automatically contains all the public, protected, and internal members of the base class except its constructors and destructors.
Incorrect:
is sometimes referred to as the first pillar or principle of object-oriented programming. According to the principle of encapsulation, a class or struct can specify how accessible each of its members is to code outside of the class or struct. Methods and variables that are not intended to be used from outside of the class or assembly can be hidden to limit the potential for coding errors or malicious exploits.
C
Classes (but not structs) support the concept of inheritance. A class that derives from another class (the base class) automatically contains all the public, protected, and internal members of the base class except its constructors and destructors.
Incorrect:
is sometimes referred to as the first pillar or principle of object-oriented programming. According to the principle of encapsulation, a class or struct can specify how accessible each of its members is to code outside of the class or struct. Methods and variables that are not intended to be used from outside of the class or assembly can be hidden to limit the potential for coding errors or malicious exploits.
send
light_mode
delete
Question #7
Which term is used to describe a class that inherits functionality from an existing class?
- ABase class
- BInherited class
- CDerived class
- DSuperclass
Correct Answer:
C
) automatically contains all the public,
protected, and internal members of the base class except its constructors and destructors.
C
) automatically contains all the public,
protected, and internal members of the base class except its constructors and destructors.
send
light_mode
delete
Question #8
Two classes named Circle and Square inherit from the Shape class. Circle and Square both inherit Area from the Shape class, but each computes Area differently.
Which term is used to describe this object-oriented concept?
Which term is used to describe this object-oriented concept?
- Apolymorphism
- Bencapsulation
- Csuperclassing
- Doverloading
Correct Answer:
A
You can use polymorphism to in two basic steps:
Create a class hierarchy in which each specific shape class derives from a common base class.
Use a virtual method to invoke the appropriate method on any derived class through a single call to the base class method.
A
You can use polymorphism to in two basic steps:
Create a class hierarchy in which each specific shape class derives from a common base class.
Use a virtual method to invoke the appropriate method on any derived class through a single call to the base class method.
send
light_mode
delete
Question #9
You create an object of type ANumber. The class is defined as follows.

What is the value of _number after the code is executed?

What is the value of _number after the code is executed?
send
light_mode
delete
Question #10
You need to allow a consumer of a class to modify a private data member.
What should you do?
What should you do?
- AAssign a value directly to the data member.
- BProvide a private function that assigns a value to the data member.
- CProvide a public function that assigns a value to the data member.
- DCreate global variables in the class.
Correct Answer:
C
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; }
}
}
C
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; }
}
}
send
light_mode
delete
All Pages