Chapter 14

Answers to Chapter 14 Review Questions

1:
  1. If Speed is a property defined inside an object called myRocket, what is the general name for the block of statements defined for the Speed property that are executed when the following line is executed?

    myRocket.Speed = 40;
    
  2. When the following line is executed?

    travelTime = distance / myRocket.Speed;
    
A1:
  1. set statement block or set accessor

  2. get statement block or get accessor

2: Which capitalization style is recommended for
  1. Instance variables?

  2. Methods?

  3. Properties?

A2:
  1. Camel casing

  2. Pascal casing

  3. Pascal casing

3: The following lines specify an instance variable declaration and what is meant to be a property with the task of allowing access to the instance variable speed from outside the object. However, ...

Get C# Primer Plus now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.