4
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by bugmenot
0

Where length is declared in java and how it works?

You can't possibly be expecting a helpful answer to a question like that. We need more detail. What is length? A user variable? Put some effort into asking the question if you want others to put effort into answering the question.

0

You can't possibly be expecting a helpful answer to a question like that. We need more detail. What is length? A user variable? Put some effort into asking the question if you want others to put effort into answering the question.

sorry i asking by using example below

int[] arr = new int[10];

int i = arr.length;

above length is declared somewhere but i dont know where is it?

0

And you don't need to. An array is a special type of Object, and length is a field of that object. But the "objectness" (yes, I can make up words) of an array is not something you need to worry about.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.