-->
当前位置:首页 > 题库

PROGRAMMING:Jmu-java-04 advanced object oriented-04 nested class static nested class

Luz5年前 (2021-05-10)题库427
Define the class' arrayutils', and create a static nested class' pairresult 'inside the class. The nested class includes:
**Properties: * * 'private double Min' and 'private double Max', used to store the minimum and maximum values
**Method: * * toString method. See the following output example for the format.
Create a static method 'pairresult findminmax (double [] values)' for the 'arrayutils' class, find the maximum and minimum values of the passed array, and return the' pairresult 'object.
###Main method description
1. Enter n to create a double array of size n
2. Input n double values into the array in turn
3. Call findminmax method to get the result and output it.
4. Finally, use 'system. Out. Println (arrayutils. Pairresult. Class)' to print identification information
###Input sample
```in
five
0 -1 1 1.1 1.1
```
###Output sample
```out
PairResult [min=-1.0, max=1.1]
\\Print the logo here
```






answer:If there is no answer, please comment