Advertisement
serg_specialist

Untitled

Nov 14th, 2021
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package dz23;
  7.  
  8. public class DZ23 {
  9.  
  10. // 2) Создать новый проект
  11. //Создать метод, который вычисляет произведение 4 чисел (значений типа int) - параметров метода.
  12. //Метод должен возвращать значение типа int.
  13. //Вызвать данный метод в методе main и вывести результат на экран.
  14. public static int mult(int a, int b, int c, int d){
  15. int result = a * b * c * d;
  16. return result;
  17. }
  18.  
  19. //
  20. public static void main(String[] args) {
  21. // TODO code application logic here
  22. // вызов метода mult
  23. int res = mult(2, 2, 3, 4);
  24. System.out.println("res=" + res);
  25. }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement