Jums IR Tik Jums

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Hvgaidanis
H
Hvgaidanis
Community Contributor
Quizzes Created: 1 | Total Attempts: 79
Questions: 20 | Attempts: 79

SettingsSettingsSettings
Jums IR Tik Jums - Quiz

.


Questions and Answers
  • 1. 

    Kas yra klasės konstruktorius?

    • A.

      Tai specifinė klasė, atsakinga už objektų kūrimą.

    • B.

      Tai operatorius, konstruojantis objektą.

    • C.

      Tai pirmasis klasės metodas, kuris yra kviečiamas konstruojant objektą.

    • D.

      Tai svarbiausias klasės metodas

    • E.

      Tai ne klasės funkcija, atsakinga už objekto konstravimą.

    Correct Answer
    C. Tai pirmasis klasės metodas, kuris yra kviečiamas konstruojant objektą.
    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.

    Rate this question:

  • 2. 

    Kiek argumentų būtina pateikti aprašant lokalų perkraunamą unarinį operatorių?

    • A.

      Nereikia nei vieno

    • B.

      Du

    • C.

      Vieną

    Correct Answer
    A. Nereikia nei vieno
    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.

    Rate this question:

  • 3. 

    Klasės objekte naudojamas "const" metodas?

    • A.

      Negali keisti šio metodo lokalių kintamujų.

    • B.

      Negali keisti klasėje deklaruotų duomenų, nesvarbu kurioje klasės prieigos srityje jie yra aprašomi.

    • C.

      Gali keisti kaip "const" taip ir ne "const" klasės duomenis klasės public srityje.

    • D.

      Option 4

    Correct Answer
    B. Negali keisti klasėje deklaruotų duomenų, nesvarbu kurioje klasės prieigos srityje jie yra aprašomi.
    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.

    Rate this question:

  • 4. 

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

    • A.

      Klasės objektą ir klasės narį

    • B.

      Rodyklę į klasę ir klasės narį.

    • C.

      Nuorodą į objektą ir klasės narį.

    • D.

      Rodyklę į objektą ir klasės narį.

    Correct Answer
    D. Rodyklę į objektą ir klasės narį.
    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.

    Rate this question:

  • 5. 

    Konstruktoriaus vardas yra tapatus

    • A.

      Klasei draugiškos funkcijos vardui.

    • B.

      Klasės vardui.

    • C.

      Konstruojamo objekto vardui.

    • D.

      Atitinkamos klasės matomumo (prieigos) srities vardui.

    Correct Answer
    B. Klasės vardui.
    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.

    Rate this question:

  • 6. 

    Bazinės klasės grynai virtualus metodas, tai metodas, kuris

    • A.

      Neturi parametrų sąrašo

    • B.

      Skirtas konstruoti virtualų objektą.

    • C.

      Negrąžina reikšmės

    • D.

      Privalo būti apibrėžtas visuose paveldėjimuose

    Correct Answer
    D. Privalo būti apibrėžtas visuose paveldėjimuose
    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.

    Rate this question:

  • 7. 

    Kur yra klaida?

    • A.

      Klaidingas metodo virtual void func(){}; apibrėžimas

    • B.

      Klaidų nėra

    • C.

      Negali būti kūriama rodyklė base *p

    • D.

      Klasėje derived1 trūksta metodo void func() apibrėžimo

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

    Rate this question:

  • 8. 

    Kur yra klaida?

    • A.

      Neteisingas "obj_A.d_error = Pi;" priskyrimas

    • B.

      Neteisingas "obj_B.b = 4;" priskyrimas

    • C.

      Neteisingas "obj_B.d_error = 2.36;" priskyrimas

    • D.

      Neteisingai konstruojamas obj_A.

    • E.

      Neteisingai konstruojamas obj_B.

    Correct Answer
    C. Neteisingas "obj_B.d_error = 2.36;" priskyrimas
    Explanation
    The incorrect assignment is "obj_B.d_error = 2.36;".

    Rate this question:

  • 9. 

    Operacija "delete"

    • A.

      Grąžina sistemai nenaudojamą dinaminę atmintį.

    • B.

      Naikina bet kokį kintamąjį.

    • C.

      Inicializuoja masyvą "0" elementais.

    • D.

      Naikina masyvą.

    Correct Answer
    A. Grąžina sistemai nenaudojamą dinaminę atmintį.
    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.

    Rate this question:

  • 10. 

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

    • A.

      Naudos bazinės klasės metodą.

    • B.

      Naudos paveldėjusios klasės metodą.

    • C.

      Naudos paveldėjusios klasės metodą, jei metodo naudojimas iš bazinės klasės neaprašytas :: operatoriumi.

    Correct Answer
    C. Naudos paveldėjusios klasės metodą, jei metodo naudojimas iš bazinės klasės neaprašytas :: operatoriumi.
    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.

    Rate this question:

  • 11. 

    Klasės deklaracijoje naudojamas "private", tai

    • A.

      Konstruktorius

    • B.

      Matomumo/prieigos srities specifikatorius

    • C.

      Klasei draugiška funkcija

    • D.

      Klasės kintamojo vardas

    • E.

      Destruktorius

    • F.

      Klasės metodas

    Correct Answer
    B. Matomumo/prieigos srities specifikatorius
    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.

    Rate this question:

  • 12. 

    "Draugiškos" ("friend") klasei funkcijos, tai

    • A.

      Ne klasės narės funkcijos;

    • B.

      Destruktoriai;

    • C.

      Konstruktoriai;

    • D.

      Klasės narės funkcijos;

    Correct Answer
    A. Ne klasės narės funkcijos;
    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.

    Rate this question:

  • 13. 

    Grynai virtualus metodas - tai virtualus metodas, kuris

    • A.

      Klasę padaro abstrakčia

    • B.

      Neturi parametrų sąrašo

    • C.

      Negrąžina reikšmės

    Correct Answer
    A. Klasę padaro abstrakčia
    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.

    Rate this question:

  • 14. 

    Virtualūs metodai:

    • A.

      Negali būti paveldimi.

    • B.

      Privalo turėti tą patį metodo kūną.

    • C.

      Negali būti konstruktoriais.

    • D.

      Negali būti destruktoriai.

    Correct Answer
    C. Negali būti konstruktoriais.
    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.

    Rate this question:

  • 15. 

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

    • A.

      Klasės narį ir klasės objektą

    • B.

      Klasės objektą ir klasę

    • C.

      Klase ir klasės narį

    • D.

      Klasės objektą ir klasės narį.

    Correct Answer
    D. Klasės objektą ir klasės narį.
    Explanation
    The "." operator (class member access operator) combines the class object and the class member.

    Rate this question:

  • 16. 

    Objektas aprašytas "const" gali naudoti tik "const" metodus

    • A.

      Teisingai

    • B.

      Neteisingai

    Correct Answer
    A. Teisingai
    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.

    Rate this question:

  • 17. 

    Kuris operatorius negali būti perkrautas?

    • A.

      ?

    • B.

      +

    • C.

      *

    • D.

      ++

    Correct Answer
    A. ?
    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.

    Rate this question:

  • 18. 

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

    • A.

      Date Today = Date(12,8,2009);

    • B.

      Date Birthday (22,1,1996);

    • C.

      Date JustDate;

    Correct Answer
    C. Date JustDate;
    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.

    Rate this question:

  • 19. 

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

    • A.

      Ne

    • B.

      Taip

    Correct Answer
    A. Ne
    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).

    Rate this question:

  • 20. 

    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?

    • A.

      D yra prieinamas, nes yra private srityje.

    • B.

      My metodas negali būti inline

    • C.

      Operacija "++" yra negalima

    • D.

      Netinkamai aprašytas konstruktorius

    • E.

      Bloga "static" kintamojo inicializacija

    Correct Answer
    E. Bloga "static" kintamojo inicializacija
    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.

    Rate this question:

Quiz Review Timeline +

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

  • Current Version
  • Mar 19, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 17, 2018
    Quiz Created by
    Hvgaidanis
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.