Harika
Harika

Reputation: 355

Matlab cell array equivalent in java

I would like to implement cell arrays (Matlab) in java. Since i am new to java programming i am not sure what could be used in java similar to cell arrays.

Can you please suggest me what can be used?

Upvotes: 1

Views: 1533

Answers (2)

Amit Bhati
Amit Bhati

Reputation: 5649

You could use arrays which are objects in java.
You can create an array in java as below:-

 int[] array=new int[10];

Above code will create an array of integers of size 10.

Two-dimensional arrays, called matrices (singular: matrix). A matrix resembles a table with rows and columns.

int [ ] [ ] marks = new int [ 4 ] [ 5 ] ; 

enter image description here

Above code int [ 4 ] [ 5 ] indicates that there will be four arrays of ints in the array marks, with 5 ints in each array of ints.

Upvotes: 1

Suresh Atta
Suresh Atta

Reputation: 121998

Java have arrays too. If you are looking for cell arrays (matrices type), the key word to use is multi dimensional arrays.

Upvotes: 0

Related Questions