GoConqr has a new look! Let us know what you think.

Module 10 of 12 · Text

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

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?