最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

有關(guān)Java開發(fā)進(jìn)階的相關(guān)問題

有關(guān)Java開發(fā)進(jìn)階的相關(guān)問題

qq_隨心依舊_0 2016-09-21 18:50:10
如何利用Java語言先用集合的方式表示出,然后添加泛型
查看完整描述

1 回答

?
拖鞋_

TA貢獻(xiàn)453條經(jīng)驗 獲得超223個贊

一行是一個對象 ?有4個屬性 先創(chuàng)建個類 比如可以取名 ?ShangPin ? ? (別問我為什么要用漢語拼音~~)

看表你需要在類里面做一個構(gòu)造方法

List<ShangPin> spList=new arrayList<ShangPin>();

然后創(chuàng)建每個對象 添加到list當(dāng)中


查看完整回答
反對 回復(fù) 2016-09-21
  • qq_隨心依舊_0
    qq_隨心依舊_0
    大神,麻煩你寫個代碼唄
  • 拖鞋_
    拖鞋_
    public class ShangPin { private Long spbh; private String spmc; private String splb; private double spjg; public ShangPin(){ } public ShangPin(Long spbh,String spmc,String splb,double spjg){ this.spbh=spbh; this.spmc=spmc; this.splb=splb; this.spjg=spjg; } public Long getSpbh() { return spbh; } public void setSpbh(Long spbh) { this.spbh = spbh; } public String getSpmc() { return spmc; } public void setSpmc(String spmc) { this.spmc = spmc; } public String getSplb() { return splb; } public void setSplb(String splb) { this.splb = splb; } public double getSpjg() { return spjg; } public void setSpjg(double spjg) { this.spjg = spjg; }
  • 拖鞋_
    拖鞋_
    這個是實體類
點擊展開后面5
  • 1 回答
  • 0 關(guān)注
  • 1114 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號