- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
Types of Array in Java
Java supports single dimensional and multidimensional arrays. See the example below:
Example
public class Tester { public static void main(String[] args) { double[] myList = {1.9, 2.9, 3.4, 3.5}; // Print all the array elements for (double element: myList) { System.out.print(element + " "); } System.out.println(); int[][] multidimensionalArray = { {1,2},{2,3}, {3,4} }; for(int i = 0 ; i < 3 ; i++) { //row for(int j = 0 ; j < 2; j++) { System.out.print(multidimensionalArray[i][j] + " "); } System.out.println(); } } }
Output
1.9 2.9 3.4 3.5 1 2 2 3 3 4
- Related Articles
- Use overloaded methods to print array of different types in Java
- How to convert an array of objects to an array of their primitive types in java?
- Types of packages in Java
- Types of variable in java
- Types of inheritance in Java
- Types of References in Java
- Types of Java comments.
- Types of access modifiers in Java?
- Types of quantifiers in Java regex
- Data types in Java
- What are the types of arrays in Java?
- Default value of primitive data types in Java
- Covariant return types in Java
- Count the number of data types in an array - JavaScript
- Bounded-types in generics in Java?

Advertisements