Challenge: Method Overloading
Завдання
Swipe to start coding
Practice Java method overloading by implementing a set of overloaded methods for calculating the area of different shapes.
- Create a public static method named
areathat takes twointparameters representing the width and height of a rectangle, and returns the area as anint. - Create another public static overloaded method named
areathat takes a singledoubleparameter representing the radius of a circle, and returns the area as adouble. - Create a third public static overloaded method named
areathat takes threedoubleparameters representing the sides of a triangle (a,b, andc), and returns the area as adoubleusing Heron's formula.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 4
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Suggested prompts:
Can you explain this in simpler terms?
What are some examples related to this topic?
Where can I learn more about this?
Awesome!
Completion rate improved to 8.33
Challenge: Method Overloading
Свайпніть щоб показати меню
Завдання
Swipe to start coding
Practice Java method overloading by implementing a set of overloaded methods for calculating the area of different shapes.
- Create a public static method named
areathat takes twointparameters representing the width and height of a rectangle, and returns the area as anint. - Create another public static overloaded method named
areathat takes a singledoubleparameter representing the radius of a circle, and returns the area as adouble. - Create a third public static overloaded method named
areathat takes threedoubleparameters representing the sides of a triangle (a,b, andc), and returns the area as adoubleusing Heron's formula.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 4
single