Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

How to find the length of an array in java

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
  }
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #How #find #length #array #java
ADD COMMENT
Topic
Name
4+1 =