I always thought that one of the concepts we learn in any language has programming arrangements or vectors are even more so when we are mere apprentices and we do not have any basis solid knowledge in this. In Java an array is a set of variables (called elements or components) that stores values \u200b\u200bof the same type. (More
).
The following example is taken and adapted from the book
" How to Program JAVA" fifth edition of Deitel
I had the opportunity to purchase this great book and really good (the publisher been reduced by 40%).
/ / Creating an array
/ / http://geekslinuxchile.blogspot.com/
/ / Adapted from the book "How to Schedule Java "Deitel
/ / http://geekslinuxchile.blogspot.com/
/ / Adapted from the book "How to Schedule Java "Deitel
{public class under public static void main (String args []) {
int array [];
/ / Declare the reference in accordance arregl0 = new int [10]; / / Create under
String output = "Index \\ tValor \\ n";
String output = "Index \\ tValor \\ n";
/ / append each string elemntos the output under
for (int counter = 0; output + = counter counter + "\\ t" + array [counter] + "\\ n";
System.out.println (output);
}}
As we do not assign any value to the array elements each element is printed with a default value (in this case 0).
(Soon .... will continue with the manual)
x Jlara < arreglo.length; contador ++ )
0 comments:
Post a Comment