亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

有關Java開發進階的相關問題

有關Java開發進階的相關問題

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

1 回答

?
拖鞋_

TA貢獻453條經驗 獲得超223個贊

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

看表你需要在類里面做一個構造方法

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

然后創建每個對象 添加到list當中


查看完整回答
反對 回復 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 關注
  • 1109 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號