セクション 1. 章 15
single
Challenge: Method Overloading
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
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.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 15
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください