اكتب كود Java لتوضيح طريقة مع 2 Parameters وبدون نوع Return
- برمجة
- برمجة جافا
- 2021-09-28
- moh2177769644130246
الأجوبة
import java.util.Scanner; public class Rectangle { double width; double height; double depth; void recarea(double x,double y) { double ar = x * y; System.out.print("area of the rectangle is :"+ar); } } class ParameterDemo { public static void main(String args[]) { Scanner s = new Scanner(System.in); System.out.print("enter length : "); double l = s.nextDouble(); System.out.print("enter breadth : "); double b = s.nextDouble(); Rectangle rec = new Rectangle(); rec.recarea(l,b); } }
القوائم الدراسية التي ينتمي لها السؤال