Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@thebigk • Jun 19, 2012
Please post the full code in the post, title is just a title. -
@dancer-engineer-EJ8rGI • Jun 19, 2012
If this is your code:
int a[] = {10,20,30}; System.out.println(a.length);Here 'a.length' gives the length of the array 'a'. -
@vikash-verma-jF0MOy • Jun 19, 2012
I mean to find array length , we use arrayname.length .
What is this length variable, where it is generated, is arrayname a class,. . . -
@anoop-kumar-GDGRCn • Jun 19, 2012
I tried to find out source code for array but didn't got it. There is array class in java.lang.reflect package but that is different and similar to array functionality.
Well answer is Array is not a class. Its a reference type. There are three reference type in java class, interface and array
it is built-in JVM part and array.length is defined as
public final <variable> length. as array length is constant which stores length of array. -
@dancer-engineer-EJ8rGI • Jun 19, 2012
#-Link-Snipped-#, you may take a look at these links:
<a href="https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html" target="_blank" rel="nofollow noopener noreferrer">Arrays (The Java™ Tutorials > Learning the Java Language > Language Basics)</a>
<a href="https://www.roseindia.net/java/master-java/Reference-Data-Types.shtml" target="_blank" rel="nofollow noopener noreferrer">Reference Data Types</a> -
@suraz-mouLU5 • Jun 19, 2012
#-Link-Snipped-#
check this out -
@vikash-verma-jF0MOy • Jun 19, 2012
#-Link-Snipped-# you are right...😎