Array initialization with default constructor

前端 未结 6 1373
渐次进展
渐次进展 2020-11-30 09:15
public class Sample
{
     static int count = 0;
     public int abc;
     public Sample()
     {
        abc = ++Sample.count;
     }
}

I want to

6条回答
  •  心在旅途
    2020-11-30 09:34

    At this point you have an empty array of size 100, if you want to fill it with items, then you would have to do something like:

    for(int i=0; i

提交回复
热议问题