(day4)Write a pair of Poker--The array

The Array in JAVA

We can define an array by this way
it's a dynamic array,which is needed to be assigned

int num[] = new num[30];

we can access it by this way

num[0] = 10;  // The first value of this array

num[1] = 11; // The second value of this array

we can output them by this way

System.out.println("num[0] = " + num[0]);

This is a static array

String stu[] = new String[]{"Jack","Marry","Bob"};

We can get its numbers(个数) by this way

System.out.println("The numbers of this array are:" + num.length);

typical definations

String[] stu = new String[]{"Jack","Marry",‘Bob"’};

invoke an array

a.

for(int i = 0; i < array.length; i++)
Systm.out.println(array[i]);

b.增强for循环

The system will acquire each valus of the arr2 and assign it to arr1,until every value is output.

for (String arr1 : arr2)
System.out.println(arr1);

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • The Great A.I. Awakening How Google used artificial intel...
    图羽阅读 1,275评论 0 3
  • 这一章讲的比特币的交易记录的细节。通过这一章你可以理解,比特币的交易是采用什么样的组织形式构成的,同时也可以看到,...
    Scalers阅读 2,279评论 1 3
  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,545评论 0 13
  • 虽然最近的天气不怎么样?一会下雨一会天晴的,但是店里的生意丝毫不受影响,做护理的客人也是陆陆续续地做完一波然后又一...
    cc_3c90阅读 128评论 0 0
  • 繁星从出生那天起就知道自己是闪耀的,不过那是很久以前的事了,现在她很宁静。 繁星讨厌月亮,明明就已经是最耀眼的了,...
    春彤与瑞雪阅读 281评论 1 4