About 50 results
Open links in new tab
  1. arrays - length and length () in Java - Stack Overflow

    Dec 27, 2009 · In Java, an Array stores its length separately from the structure that actually holds the data. When you create an Array, you specify its length, and that becomes a defining attribute of the …

  2. What is the time complexity of String.length () in Java?

    String internally maintains an array of characters and length of the array is a property of array object hence O (1) as its simple reading of property.

  3. java - Difference between size and length methods? - Stack Overflow

    Nov 25, 2013 · 103 size() is a method specified in java.util.Collection, which is then inherited by every data structure in the standard library. length is a field on any array (arrays are objects, you just don't …

  4. java - What's the difference between length and length ... - Stack …

    Dec 30, 2011 · length is a pseudo-data member reference, and only works for (small-a) arrays (ignoring classes that you may define that implement the member). Everything else is an object of a class, and …

  5. Getting the array length of a 2D array in Java - Stack Overflow

    I need to get the length of a 2D array for both the row and column. I’ve successfully done this, using the following code: public class MyClass { public static void main (String args []) { ...

  6. java - When to use .length vs .length () - Stack Overflow

    But when you are using people[i].length(), you are accessing the string at that position of the array, and getting the length of the string, therefore using the .length() method in the String class. However, just …

  7. What is inside code for array.length() in Java? - Stack Overflow

    May 3, 2013 · In Java, arrays are more like objects with a special "instance variable"-like variable length that indicates how many slots there are in the array. This special "instance variable" is set at the …

  8. Is there a substring(start, length) function? - Stack Overflow

    Oct 7, 2013 · 11 I am trying to use a similar method to C#'s string.SubString(int start, int length). But the substring function in Java is string.substring(int start, int end). I want to be able to pass a start …

  9. How can we find the length of a String in Java without using any ...

    Mar 9, 2016 · Please reference String length without using length () method EDIT: Apologies, the javahungry and codenirvana links used one of these methods that were to be excluded. Following …

  10. java - What is the "String [] args" parameter in the main method ...

    May 21, 2009 · That String[] args part may become optional in future versions of Java. Work is underway to allow for simplified declaration of main method. See JEP 463: Implicitly Declared …