Array
// this is sumple array
let array=[1,2,3,4]
What is Array?
• An array is a container object that holds a fixed number
of values of a single type. The length of an array is established
when the array is created. After creation, its length is fixed.
You have seen an example of arrays already, in the main
method of the "Hello World!" application.
This section discusses arrays in greater detail.
• Each item in an array is called an element,
and each element is accessed by its numerical index.
• Advantage of Java Array
o Code Optimization: It makes the code optimized,
we can retrieve or sort the data easily.
o Random access: We can get any data located at any index position.
• Disadvantage of Java Array
o Size Limit: We can store only fixed size of elements in the array.
It doesn't grow its size at runtime. To solve this
problem, collection framework is used in java.
array
<!DOCTYPE html>
<html>
<body>
<script>
var str = ["1818-15-3", "1819-16-3"];
var arr = str.split(":");
document.write(arr[1] + ":" + arr[2]);
</script>
</body>
</html>
array
$ git config --global user.name "Yad Sallivann"
$ git config --global user.email [email protected]
array
const person = ["John", "Doe", 46];
array
from array import *
array_num = array('i', [1,3,5,7,9])
for i in array_num:
print(i)
print("Access first three items individually")
print(array_num[0])
print(array_num[1])
print(array_num[2])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us