GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

OOP

Kevin Nelson PHP 1 Englisch 15 Karten

OOP

Karten in diesem Stapel (15)

  1. 1How many times is a static class instantiated?Once
  2. 2Call a static class from a parentCall a static class from a parent
  3. 3What's the point of static classes?1. The state of static class doesn't change
    2. Can be called globally
  4. 4Whats' different about read-only classes?All their properties act like read-only properties.
  5. 5What's different about read-only properties?1. They cannot have a default value.
    2. They can only be assigned a value once.
    3. Can only be set by a method of their class even if they are public
    4. They cannot be unset.
  6. 6Can a child redeclare a method or constant of its parent?Yes, if the parent method is not "final".
  7. 7What class type cannot have a child?A "final" class
  8. 8Can a child remove an argument from a redeclared method?No, a child can only add arguments when redeclaring a method
  9. 9Is this valid in PHP? $result = $repository?->getUser(5)?->name;Yes, PHP has a null safe operator
  10. 10How do you access a constant in a class?::
  11. 11What is encapsulation?Putting things in a class. This ...
    1. Creates Abstraction
    2. Controls access ( private, public, etc )
    3. Hides Data
  12. 12What's the difference between protected and private?Protected -> Accessible from code within class or child
    Private -> Only accessible from code within class
  13. 13What is an abstract class?A class where is functions are declared but not implemented
  14. 14How is a abstract class different from a interface?1. interfaces don't have public functions with bodies.
    2. Interfaces don't have properties
    3. A class can implement multiple interfaces
  15. 15Trade-offs of using traits vs dependency injection?1. Less boilerplate
    2. "Inherit" multiple classes
    3. Trait properties, functions become apart of the class its used in.

Informationen

Beschreibung
1 PHP Karteikarten am OOP, erstellt von Kevin Nelson am 08/05/2024.
Erstellt von
Kevin Nelson
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck