O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Objects, Methods

Ia Mgvdliashvili Inglês 39 flashcards

Flashcards do conjunto (39)

  1. 1describe "type' using entitiesentities grouped together by some sort of similarity
    • can be thought of as a (mathematical) set of entities
  2. 2what is equivalent of entity in programming?object
  3. 3what is equivalent of type in programming?class
  4. 4what is equivalent of subtyping in programming?inheritance
  5. 5which of following need to be present in the language for it to be called object oriented? 1. object, 2. class, 3.inheritance1 and 2 are necessary, 3 is optional.
  6. 6which of following need to be present in the language for it to be called object oriented? 1. subtyping, 2. entities, 3.type2 (objects) and 3 (classes) are necessary, 1(inheritance) is optional
  7. 7what is an invariant?a condition that always holds for an entity
  8. 8what is a condition that always holds for an entity called?invariant
  9. 9give example of invarianta condition that always holds for an entity
    ⋄ e.g. neither the age, nor the height of a person can be negative
  10. 10what is a property called in OO languages?data field
  11. 11what is an operation called in OO languages?method
  12. 12is instation of an object pure or has side effect?the instantiation expression has a side effect (the object is created)
  13. 13what is return value of object instatiation?reference to the object
  14. 14what is a keyword for immutable primitive types?final
  15. 15can immutable reference types be modified to refer to another object?no
  16. 16can immutable reference types be modified to refer to null object?no
  17. 17how is immutability implemented?the pointer (with the memory address) is immutable
  18. 18can the date of an immutable object change?yes
  19. 19what is the field which always has exactly one instance of it, and that belongs to the classstatic
  20. 20do instances own an independent copy of a static field?no
  21. 21can a static field exist if no instances of the class have been made?yes
  22. 22where is a static field stored, heap or memory?heap
  23. 23is the class loaded before the first use of it(instance), or is it loaded when creating first instance?it's loaded before
  24. 24does java create a default constructor if other one has been coded?no
  25. 25how can a constructor call other constructors?with "this" keyword
  26. 26where can a call to another constructor appear?it can only be the first statement in the constructor
  27. 27which of these can we overload: number or types of arguments?both
  28. 28how can arguments be passed upon method/constructor invocation?call by value, call by sharing
  29. 29when (call by value or sharing) is an argument reference?call by sharing
  30. 30which types are passed by value in java?primitive types
  31. 31how are primitive types passed in java, by value or by sharing?value
  32. 32how can we ensure preserving invariants for the objectby encapsulation
  33. 33(encapsulation) what is deifference between shallow and deep copy?• shallow copy: only the outmost references are separated (used on arrays, the clone method makes such a copy)
    • deep copy: when shallow copying is not enough, all internal references
    are copied
  34. 34which can be initialised with null value, variables or objects?both
  35. 35which type of access modifiers make up the interface of an object?public
  36. 36how can we use method chaining?by returning that object at the end of method
  37. 37which one returns void as return type, function or procedure?procedures
  38. 38how can can static methods have "this": as its argument or return type?neither
  39. 39can static methods call non-static methods?no, except if we pass it an object reference

Informações

Descrição
FlashCards sobre Objects, Methods, criado por Ia Mgvdliashvili em 15-12-2017.
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?