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

Módulo 10 de 12 · Texto

Return new

Brenda Gabriela Senra da Silva

We use:

🔹 return new Something()

When the method must return an object.

Example:

public static Person createPerson() {

return new Person("Brenda"); }

Here:

  • The return type is Person

  • So we must return a Person object

  • new Person(...) creates that object

Instrucciones

Para avanzar en el curso, envía un intento de este test. Puedes enviarlo después de la última pregunta.

Ir al módulo elegido

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?