CodeGym /Courses /Java Core /Practice overloading methods | Level 5

Practice overloading methods | Level 5

Java Core
Level 5 , Lesson 4
Available

"Hello, Amigo!"

4
Task
Java Core, level 5, lesson 4
Locked
Something superfluous
Our program is once again full of unnecessary lines of code. Let's correct this blunder by removing all the extra methods, so that the program displays text (and only the text) that corresponds to the task conditions. By the way, you need to get used to this. Junior developers' special ability to create unnecessary code is pretty annoying to senior developers.
8
Task
Java Core, level 5, lesson 4
Locked
OOP: Method overloading
Let's display matrices in different ways, however we want. OOP gives us a wonderful tool for this: method overloading. Overload the printMatrix method in 8 different ways. You should end up with 10 different printMatrix methods.
4
Task
Java Core, level 5, lesson 4
Locked
OOP: Method overloading - Eliminating the superfluous
Not every overloaded method is useful. And so it is in this program. Look at the code and think about which implementation of the print method will be called. Then remove all the superfluous implementations of the method - and you're done.
4
Task
Java Core, level 5, lesson 4
Locked
Man or woman?
Something in this program isn't right... It seems to display the names of men, but not those of women. Put an end to the discrimination: change the printName method so that it runs for both man and woman. The method should have a single implementation.
4
Task
Java Core, level 5, lesson 4
Locked
Be gone, all that is unnecessary!
Again, we have extra lines in a program. They've resulted in a bug, because the program tries to call the add method for cases for which it is not implemented. We won't override the superfluous add methods this time. We'll do something simpler: delete the lines for which there is no implementation.
Comments (14)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
tomtom6789 Level 1, University Place, United States
14 May 2024
i dont get the first one 😓
Daniel Ketcheson Level 28, Canada
3 July 2023
OOP : Method overloading is the first time I inserted a double double into Java It was the wrong thing to do.
vhunjek Level 33, Varazdin, Croatia
27 January 2022
OOP: Method overloading validator doesn't accept different. solutions
Michael Amann Level 22, United States of America, United States
29 June 2022
I nailed it the first try. LOL
Gellert Varga Level 23, Szekesfehervar, Hungary
7 March 2021
First task: "Junior developers' special ability to create unnecessary code is pretty annoying to senior developers." :-D
Ryan Vibbert Level 1, Columbus, United States
3 February 2021
Be gone, all that is unnecessary requirements should be more clear. "There must be three add() methods implemented in the Solution class" is misleading. That should be updated to say must be at least three.
Anatoly Level 17
28 February 2021
+100 - same confusing!
Brad Reed Level 19, Hartford, United States
23 July 2020
Random reminder: trying anything listed medium/hard on an iPad is just adding extra difficulty....
oli blaustrom Level 18, Luzern, Switzerland
25 February 2020
count your print max methods in 2, if you have 11 instead of 10 it will not pass. has to be exactly 10. what a bother.
Pershawn Horace Level 17, San Francisco, United States
9 January 2020
This way of learning the task is great helps me a lot. It almost feeling cheating to have the methods already written, but i understand that they help with debugging and having you find out why its not working and why something should be the way that it is.
Hossein Shams Level 1, Atlanta, United States
6 August 2019
I feel like I'm cheating when using IntelliJ IDEA over these practices.
Justin Johnson Level 31, Clearwater, United States
21 January 2020
Using the correct tool for the job is not cheating. Work smarter, not harder.
JeRiF94 Level 22, Baku, Azerbaijan
8 May 2019
Done!