¡GoConqr estrena diseño! Cuéntanos qué te parece.

Fichas

OOP - Constructors

nhunsdale02 Programming I Masters Inglés 9 fichas

Fichas del conjunto (9)

  1. 1Does every class have to have a constructor?Yes, even if you do not make one a default constructor will be created
  2. 2A Constructor with Arguments create a constructor for a class called Nathan with paramters name, age, and house numberpublic Nathan(String name, int age, int houseNo){
    this.name = name;
    this.age=age;
    this.houseNo=houseNo;
    }
  3. 3"this" keyword What is it?A reference to the current object
  4. 4"this" keyword Does it refer to the instance variable or the Parameter name?instance variable
  5. 5Overloading What does it mean?The same method/constructor can be defined with more than one signature
  6. 6Constructors with Arguments What are the 4 benefits?- Create and initialize values in one go
    - Quicker for programmer
    - Quicker for Application(less operations)
    - Less testing
  7. 7Control of Variable Initialization Constructors can be used to apply _____ _____business rules
  8. 8Default instructor Should you always include one even if there is a constructor that takes parameters?YES
  9. 9Constructors with Parameters What is the main advantage?Convenience...creating an object and putting in the data in one go

Información

Descripción
Masters Programming I Fichas sobre OOP - Constructors, creado por nhunsdale02 el 06/06/2014.
Creado por
nhunsdale02
Visitas
21
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?