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

consumers influence how goods and services are made by
what is another way to write 0.7
China is separated from indian subcontinent by the himalayan mountains found at
Fernando is starting a new sales job, and needs to decide which of two salary plans to choose from. For plan A, he will earn $100/week plus 15% commission on al
find the equuvalent fraction for each number 4/5
Complete the sentence.. Make your own comparison "The feeling of being lost in the overgrown garden was similar to..." PLEASE HELP MEEEEEEEE
What is the greatest common factor of 40 and 36
What is the definition of mercantilism?
Do covalent bonds give water a low heat capacity?
What are the first organisms to grow in new or disturbed areas