2016年5月10日 星期二

android java 物件陣列如何傳constructor參數

Category [] categories = new Category[4];
categories[0] = new Category(10);
categories[1] = new Category(20);
categories[2] = new Category(30);
categories[3] = new Category(40);



private Category[] categories = new Category[4];
private Category[] categories = {new Category(max), new Category(max), new Category(max), new Category(max)};

  © Blogger templates Psi by Ourblogtemplates.com 2008

Back to TOP