java数组逆序,第二个for循环没有执行是为什么?

import java.util.*;
public class Execise {

public static void main(String[] args) {

   Scanner input=new Scanner(System.in);
     System.out.println("输入5个数");
     double[]number=new double[5];
     double temp;

    //遍历
    for(int i=0;i<=number.length;i++){
        number[i]=input.nextDouble();
        System.out.println(number[i]+"+"+number);

    }
    //倒序
    for(int start=0,end=number.length-1;start<=end;start++,end--){
                temp=number[start];
                number[start]=number[end]; 
        number[end]=temp;
        System.out.println(number[end]);
    }

第一个循环的i<=number.length要写成i<number.length,数组索引越界了

数组倒叙:

public static void main(String[] args) {
     int num[] = { 1, 4, 6, 78, 23, 9 };
     for (int i = num.length - 1; i >= 0; i--) {//倒序输出
         //如果想得到这个倒叙的数组,就新定义一个数组
         //这里写入
     System.out.print(num[i] + "\t");
     }
}

Scanner input=new Scanner(System.in);
int[]arr=new int[5];
int i;
int j;
int temp;

    for(int k=0;k<arr.length;k++){
        System.out.println("请为第"+(k+1)+"位数赋值:");
        arr[k]=Integer.parseInt(input.nextLine());
    }
    for(i=0;i<arr.length-1;i++){
        for(j=arr.length-1;j>i;j--){
            if(arr[j] > arr[j-1]){
                temp=arr[j];
                arr[j]=arr[j-1];
                arr[j-1]=temp;
            }
        }
    }
    System.out.println("-----------输入-----------");
    for(i=0;i<arr.length;i++){
        System.out.println(arr[i]);
    }


    你拿我这些代码去试试看,能不能完成数值倒序输出

Integer[] a = {1,695,65,1,8,3,4,73,2,6,9,8,7};

        List<Integer> ii = new ArrayList<>();
        List<Integer> collect = Arrays.stream(a).sorted(Comparator.reverseOrder()).collect(Collectors.toList());
        System.out.println();
        collect.forEach(c ->{
            System.out.println("  "+c);
        });