Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Polymorphism | Section
Practice
Projects
Quizzes & Challenges
Quizer
Challenges
/
Java Object-Oriented Programming (OOP) Fundamentals

bookChallenge: Polymorphism

Task

You are given a Parent class and a Child class that inherits from the Parent class. Your task is to override the parent method named method in the Child class so that it returns "This is the overridden method!".

Next, you need to overload this method by adding a parameter int parameter so that the method returns: "This is the overloaded method with int parameter: " + parameter.

Note that the methods should return these values, not display them on the screen!

Feel free to use the "Hint" and "Solution" buttons if you have difficulties understanding the task.

Note
Note

Please do not modify the Parent class!

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 20

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

bookChallenge: Polymorphism

Sveip for å vise menyen

Task

You are given a Parent class and a Child class that inherits from the Parent class. Your task is to override the parent method named method in the Child class so that it returns "This is the overridden method!".

Next, you need to overload this method by adding a parameter int parameter so that the method returns: "This is the overloaded method with int parameter: " + parameter.

Note that the methods should return these values, not display them on the screen!

Feel free to use the "Hint" and "Solution" buttons if you have difficulties understanding the task.

Note
Note

Please do not modify the Parent class!

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 20
some-alt