How to find the size of an array
a)array.length()
b)array.length
c)array.size()
d)array.size
Answers were Sorted based on User's Feedback
Answer / jigar gandhi
Answer is b
array.length is for array
and
array.size() is for arraylist
| Is This Answer Correct ? | 37 Yes | 1 No |
Answer / nagesh
length is a public static final variable in an array which
will specify the capacity of that array. length() is a
function on strings to find number of characters in that.
| Is This Answer Correct ? | 11 Yes | 6 No |
What is oops in java?
Is java supports multiple inheritance? explain?
Can a source file contain more than one class declaration?
Why declare Main() method as a static in java ?
what is the default value of a variable char?(If not assigned)
What is difference between overloading and overriding?
How does compareto work in java?
Write a program to print 15 random numbers using foreach of java 8?
Why a dead thread occurs?
Can you instantiate the math class in Java?
What happens if I remove static from main method?
System.out & System.in are final static data member of System class but we can change there reference through setOut() & setIn() method how...