- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is an array and what is it used for?
An array is a data container which holds a fixed length of elements of homogeneous data type. It is used to store the elements of the same datatype.
Example
public class ArrayExample { public static void main(String args[]){ int myArray[] = {44, 69, 89, 635}; for (int i = 0; i<myArray.length; i++){ System.out.println(myArray[i]); } } }
Output
44 69 89 635
Advertisements