"Hello, Amigo! It's me—again. I've got a gift for you: a bunch of interesting assignments. No need to thank me. Take it easy!"
3
Task
Java Core,
level 2,
lesson 4
Locked
We're on overload!
It is a good thing that Java supports method overloading! It solves so many problems and gives us so much freedom! So, let's add it to your arsenal and continue to master it through practice. This time let's write two methods named print. One will print a whole number, and the other a string.
3
Task
Java Core,
level 2,
lesson 4
Locked
int and Integer
At the end of the first quest, you learned that every primitive type in Java has a corresponding non-primitive class. Soon these non-primitives will be everywhere, mark my words! But for now, we'll write two different screen output methods: one for the primitive int and a second for the non-primitive Integer class.
3
Task
Java Core,
level 2,
lesson 4
Locked
Freedom of the press
In CodeGym, we believe in freedom of the press. No secrets here! Write whatever you'd like, whenever you'd like. Just be sure to create special methods for it, so we can practice overloading these methods. So, write five different print methods with take different parameters. Which ones? Whatever comes to mind!
3
Task
Java Core,
level 2,
lesson 4
Locked
Three methods and a minimum
Is it possible to compare two numbers of different types? The overwhelming majority of humans can handle this task. But for robots, it is really difficult. For them, trying to compare a double with an int would be like asking a human to compare something warm with something soft. Let's not wear out the robots: create 3 overloaded min methods using long, double, and int.
3
Task
Java Core,
level 2,
lesson 4
Locked
Three methods and a maximum
We've once again entered the orbit of Planet Linear Chaos, home of the Ordered Isomorphs. Anyone who wants a visa must first solve a sorting and ordering problem. This time they are being very nice to you. They're giving you a super simple task: you need to create 3 methods that return the maximum of two longs, doubles, or ints.
GO TO FULL VERSION