推荐回答
其实这种最基础的题目,你自己想一下就做出来了。publicclassStock{privateStringsymbol;privateStringname;privatedoublecurrentPrice;publicStock{}publicvoiddisplay{System.out.println""+this.symbol+""+this.name+":"+this.currentPrice;}publicStringgetSymbol{returnsymbol;}publicvoidsetSymbolStringsymbol{this.symbol=symbol;}publicStringgetName{returnname;}publicvoidsetNameStringname{this.name=name;}publicdoublegetCurrentPrice{returncurrentPrice;}publicvoidsetCurrentPricedoublecurrentPrice{this.currentPrice=currentPrice;}。
边历嵚2019-12-21 18:58:47
提示您:回答为网友贡献,仅供参考。