nataudleung9811 nataudleung9811
  • 23-07-2019
  • Computers and Technology
contestada

Class members are accessed via the ____(1)_____ operator in conjunction with the name of an object of the class, or via the ___(2)_____ operator in conjunction with a pointer to an object of the class.

Respuesta :

SaniShahbaz
SaniShahbaz SaniShahbaz
  • 27-07-2019

Answer:

1.ClassName and . operator

2. ClassName and [] operator

Explanation:

There are two ways to get the members of a class first one is by using dot(.) operator.

Example : with assumption that person is a class object and age is the member in it we can use it as:

person.age

Second way is to use [] operator with member as a string in it which is used by the compiler as key to get its value.

Example : person["age"]

Answer Link

Otras preguntas

River raft rentals are 7$ per hour plus a deposit fee of $25 per person. Write an expression for the total cost of renting a raft for h numbers of hours.
Selena brought 3.75 pounds of meat for $4.64 per round. what was the total cost of meat?
Convert the following Celsius degrees to Fahrenheit. a. 35° C b. 500° C c. 10° C d. 55° C
I need help. ASAP! Look at the picture below. (7)
How were the lives of Athenian women similar to the lives of other Greek women? Select all that apply. a. They had to obey their fathers and husbands. b. They w
James sufferes from a heart atack. His heartbeat and breathing stopped completely. How would you help him
how did the status of women change during the roman empire?
12-7(8*9) 825-82-77[tex]12 - 7(8x9) = [/tex]
The graph shows the number of laps that kailee ran around a track over a given amount of time
which of the following is an example of good insulator A. water B. carbon C. rubber D. all of the above