3 pytania - języki zorientowane obiektowo

3 pytania - języki zorientowane obiektowo
A9
  • Rejestracja:około 11 lat
  • Ostatnio:ponad 6 lat
0

Witam, uczę się na exam i mam problem z trzema pytaniami po angielsku. Pomógłby mi ktoś odpowiedzieć?
1.From the list, select true sentences:
a)Constructor functions cannot return values.
b)A function name is the only identifier that can be followed by parentheses.
c)Constructor functions can receive values.
d)We can call a constructor function for an object only once in a program.
e)We pass a value to a constructor in a declaration.
2.From the list, select true sentences:
a)The private data members of base classes remain private to that class.
b)Inheriting from two or more base classes is called multiple inheritance.
c)Creating levels of inheritance is also called multiple inheritance.
d)Even a pure virtual function needs a definition.
e)Virtual objects can be created from virtual classes.
3.From the list, select true sentences:
a)Defining a class reserves memory for the class's data members.
b)Declaring an object reserves memory for the data members of the object's class.
c)An object of a class (with the class defined at the beginning of a program outside the body of any function) can be declared only in member functions.
d)Only private member functions can access private member data.
e)Only public member functions can access public member data

edytowany 1x, ostatnio: arturek999
spartanPAGE
Nienawidzę, gdy słowa 'metoda' i 'funkcja' są używane zamiennie.
_13th_Dragon
metoda to funkcja składowa, czyli jednak funkcja, aczkolwiek też mnie to czemuś drażni.
Shalom
  • Rejestracja:około 21 lat
  • Ostatnio:prawie 3 lata
  • Lokalizacja:Space: the final frontier
  • Postów:26433
0

No i jakie są twoje odp?


"Nie brookliński most, ale przemienić w jasny, nowy dzień najsmutniejszą noc - to jest dopiero coś!"
Azarien
  • Rejestracja:ponad 21 lat
  • Ostatnio:około 4 godziny
0

We can call a constructor function for an object only once in a program.

Short answer: yes.
Long answer: it depends what you mean.

Jestem bardzo ciekaw, jaka jest „prawidłowa” odpowiedź na tak nieprecyzyjnie zadane pytanie.

Zobacz pozostałe 2 komentarze
Shalom
Inaczej to zrozumiałem. Ale jeśli rozumieć to jako "jedno wywołanie dla jednego obiektu" to faktycznie :-)
vpiotr
To chyba też test z angielskiego. Ja bym napisał "Yes and No". Yes = for a single object, No - for an object.
Azarien
ale "an object" to to samo co "a single object"
vpiotr
a nie jest to forma nieokreślona rzeczownika?
Azarien
a/an niesie podtekst “one”, więc dodanie “single” nie zmienia znaczenia zwrotu.
A9
  • Rejestracja:około 11 lat
  • Ostatnio:ponad 6 lat
0

To są dobre odpowiedzi:

  1. a),c),e)
  2. a), b)
  3. b)
Sopelek
  • Rejestracja:prawie 13 lat
  • Ostatnio:ponad 8 lat
  • Lokalizacja:Kraków
  • Postów:467
0

Według mnie

  1. e)We pass a value to a constructor in a declaration. nie pasuje mi to, że chodzi o deklarację, według mnie to zdanie jest fałszywe.
  2. d)We can call a constructor function for an object only once in a program. jest prawdziwe, chciałbym zobaczyć przykłady, które rzekomo pokazują, że to jest fałsz
edytowany 1x, ostatnio: Sopelek
gośćabc
1. d) w kodzie już nawet nie widać, że callujesz konstruktor, wyrażenie z listą inicjalizacyjną załatwia wszystko za Ciebie
Sopelek
Co nie zmienia faktu, że więcej niż raz tego nie zrobisz.

Zarejestruj się i dołącz do największej społeczności programistów w Polsce.

Otrzymaj wsparcie, dziel się wiedzą i rozwijaj swoje umiejętności z najlepszymi.