📜  如何在java代码示例中找到数组的长度

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

代码示例1
class Main {
  public static void main(String[] args) {
    // Creating an array called x.
    String[] x = new String[]{"This", "Should", "return", "4"};
    // "x.length" finds the length of the array "x".
    System.out.println(x.length);
    // returns 4
  }
}