+ 2

array

can anyone teach me array...

28th Nov 2017, 3:27 AM
Sauvik Saha
Sauvik Saha - avatar
3 Respuestas
28th Nov 2017, 4:33 AM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 3
Array is a user-defined datatype it means it a a datatype which is define by user in most of the language like C, C++, etc. But not in Java java treat array as a class.Yup,array is a class in Java.So when we need an array we create it by creating as object with the help of new keyword. Syntax: <datatype> <array_name> = new <datatype>[<size> Example: int arr = new int[10]; There are also some predefined methods available in Array class like <array_name>.length().Its return length of the array as integer value.
28th Nov 2017, 4:30 AM
Faisal Rahman
Faisal Rahman - avatar