📜  如何在java代码示例中获取数组作为输入

📅  最后修改于: 2022-03-11 14:52:13.244000             🧑  作者: Mango

代码示例1
public class TakingInput {

    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);

        System.out.println("enter number of elements");

        int n=s.nextInt();

        int arr[]=new int[n];

        System.out.println("enter elements");

        for(int i=0;i