Jums IR Tik Jums

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Hvgaidanis
H
Hvgaidanis
Community Contributor
Quizzes Created: 1 | Total Attempts: 94
| Attempts: 94 | Questions: 20
Please wait...
Question 1 / 20
0 %
0/100
Score 0/100
1. Kas yra klasės konstruktorius?

Explanation

A class constructor is the first method in a class that is called when an object is being created. It is responsible for initializing the object and setting its initial state.

Submit
Please wait...
About This Quiz
Jums IR Tik Jums - Quiz

.

Personalize your quiz and earn a certificate with your name on it!
2. Kiek argumentų būtina pateikti aprašant lokalų perkraunamą unarinį operatorių?

Explanation

No arguments are required to describe a local unary operator because a unary operator operates on a single operand. Therefore, it does not require any additional arguments to perform its operation.

Submit
3. Class Date { ... Date (int, int, int) } Kuris konstruktorius blogas?

Explanation

The constructor for the Date class is incorrect for the object "JustDate". It is missing the assignment operator (=) after the constructor arguments, which means that the object "JustDate" is not being properly initialized with a specific date.

Submit
4. Kuris operatorius negali būti perkrautas?

Explanation

The question is asking which operator cannot be overloaded. The correct answer is "+". This means that the "+" operator cannot be overloaded in the given context. Overloading an operator means giving it a different behavior when used with certain types of operands. However, in this case, the "+" operator cannot be overloaded.

Submit
5. Klasės deklaracijoje naudojamas "private", tai

Explanation

The correct answer is "Matomumo/prieigos srities specifikatorius" (Visibility/access specifier). In class declaration, the "private" keyword is used to specify the visibility/accessibility of class members. It restricts the access to those members only within the class itself, and they cannot be accessed from outside the class. This keyword is used to enforce encapsulation and data hiding in object-oriented programming.

Submit
6. Konstruktoriaus vardas yra tapatus

Explanation

The correct answer is "Klasės vardui" because the sentence "Konstruktoriaus vardas yra tapatus" translates to "The constructor's name is identical". In object-oriented programming, a constructor is a special method used to initialize objects. The name of the constructor is the same as the name of the class it belongs to. Therefore, the answer "Klasės vardui" means "For the class name" and is the most appropriate choice in this context.

Submit
7. Objektas aprašytas "const" gali naudoti tik "const" metodus

Explanation

This statement means that an object declared as "const" can only use methods that are also declared as "const". In other words, if an object is declared as "const", it cannot call any methods that modify the object's state or have side effects. This is because the "const" keyword indicates that the object should not be modified. Therefore, it is correct to say that an object declared as "const" can only use "const" methods.

Submit
8. "Draugiškos" ("friend") klasei funkcijos, tai

Explanation

The correct answer is "Ne klasės narės funkcijos" which translates to "Not member functions of the class". This is because the given options are describing different types of functions, and "Ne klasės narės funkcijos" is the only option that does not refer to functions that are part of the class. The other options refer to destructors, constructors, and member functions of the class.

Submit
9. Grynai virtualus metodas - tai virtualus metodas, kuris

Explanation

This statement explains that the virtual method "Grynai virtualus metodas" makes the class abstract. In object-oriented programming, an abstract class is a class that cannot be instantiated and is meant to be subclassed. It serves as a blueprint for other classes to inherit from. By making a method virtual, it allows the subclass to override the method and provide its own implementation. Therefore, by making the "Grynai virtualus metodas" virtual, the class becomes abstract.

Submit
10. Class A{}; class B{}; void main () { A obj_A;    B obj_B; obj_A=obj_B; } Ar galimas toks kopijavimas?

Explanation

In the given code, objects of class A and B are created. However, object obj_A of class A cannot be assigned the value of object obj_B of class B because they are of different types. The assignment operator (=) can only be used to assign values between objects of the same class or compatible types. Therefore, the given assignment is not possible, resulting in the answer "Ne" (No).

Submit
11. Class A { private:  int d; static i_static = 10; public : A(){d=0;}; Inline int My () const {return d;} void const_Your() {d++;} } Kur klaida?

Explanation

The answer is "Bloga 'static' kintamojo inicializacija" because the static variable "i_static" is not properly initialized. It should be declared with a type and a semicolon after the declaration.

Submit
12. Klasės objekte naudojamas "const" metodas?

Explanation

The "const" method used in a class cannot modify the data declared in the class, regardless of which access scope they are described in.

Submit
13. "." operatorius (prieigos prie klasės nario operatorius) apjungia sekančius elementus (skaitant iš kairės į dešinę).

Explanation

The "." operator (class member access operator) combines the class object and the class member.

Submit
14. Operacija "delete"

Explanation

The operation "delete" returns unused dynamic memory to the system. It can be used to deallocate memory that was previously allocated dynamically using the "new" operator. This helps in managing memory efficiently and preventing memory leaks. The other options mentioned in the question, such as destroying variables or initializing an array with zero elements, are not the main purpose of the "delete" operation.

Submit
15. Kur yra klaida?

Explanation

The incorrect assignment is "obj_B.d_error = 2.36;".

Submit
16. "->" operatorius apjungia sekančius elementus (skaitant iš kairės į dešinę)

Explanation

The "->" operator is used to access a member of an object through a pointer. It is used to dereference the pointer and access the member of the object it is pointing to. In this case, the correct answer states that the "->" operator combines a pointer to an object and a member of that object, allowing access to the member through the pointer.

Submit
17. Jei bazinė ir paveldėjusi klasės naudoja metodus su tokiais pačiais vardais, tai paveldėjusios klasės objektas

Explanation

If a derived class inherits methods with the same names from both the base and derived classes, the object of the derived class will use the method from the derived class if the method usage is not specified in the base class using the :: operator.

Submit
18. Kur yra klaida?

Explanation

The correct answer is "Klaidų nėra." This means that there are no errors in the given code or statement.

Submit
19. Bazinės klasės grynai virtualus metodas, tai metodas, kuris

Explanation

The correct answer is "Privalo būti apibrėžtas visuose paveldėjimuose" because a base class purely virtual method must be defined in all of its derived classes. This means that each derived class must provide its own implementation of the virtual method, ensuring that it is not left undefined and can be called correctly from any instance of the derived class.

Submit
20. Virtualūs metodai:

Explanation

Virtualūs metodai negali būti konstruktoriais, nes konstruktorius yra speciali klasės metodo rūšis, kuris naudojamas objekto inicijavimui ir jo inicializavimui. Virtualūs metodai yra skirti perrašyti (override) tėvo klasėje esančius to paties pavadinimo metodus vaikinėse klasėse. Taigi, virtualūs metodai negali būti naudojami objekto kūrimui ir inicializavimui, todėl negali būti konstruktoriais.

Submit
View My Results

Quiz Review Timeline (Updated): Jul 22, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jul 22, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 17, 2018
    Quiz Created by
    Hvgaidanis
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Kas yra klasės konstruktorius?
Kiek argumentų būtina pateikti aprašant lokalų perkraunamą...
Class Date { ...
Kuris operatorius negali būti perkrautas?
Klasės deklaracijoje naudojamas "private", tai
Konstruktoriaus vardas yra tapatus
Objektas aprašytas "const" gali naudoti tik...
"Draugiškos" ("friend") klasei funkcijos,...
Grynai virtualus metodas - tai virtualus metodas, kuris
Class A{}; ...
Class A { ...
Klasės objekte naudojamas "const" metodas?
"." operatorius (prieigos prie klasės nario operatorius)...
Operacija "delete"
Kur yra klaida?
"->" operatorius apjungia sekančius elementus (skaitant...
Jei bazinė ir paveldėjusi klasės naudoja metodus su tokiais...
Kur yra klaida?
Bazinės klasės grynai virtualus metodas, tai metodas, kuris
Virtualūs metodai:
Alert!

Advertisement