Java Minimum and Maximum values in Array

前端 未结 13 1018
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 06:32

My code does not give errors, however it is not displaying the minimum and maximum values. The code is:

Scanner input = new Scanner(System.in);

int array[]          


        
13条回答
  •  盖世英雄少女心
    2020-12-01 07:17

    getMaxValue(array);
    // get smallest number
    getMinValue(array);
    

    You are calling the methods but not using the returned values.

    System.out.println(getMaxValue(array));
    System.out.println(getMinValue(array)); 
    

提交回复
热议问题