实验11泛型与集合.docVIP

  • 3
  • 0
  • 约4.24千字
  • 约 4页
  • 2020-07-12 发布于广东
  • 举报
精选文档 PAGE PAGE 4 — 实验内容: (1) 定义一个泛型类 InstrumentE ,其中包括一个泛型方法 void play(E x)。 定义两种乐器类:Cello、Violin 可以进行演奏。定义一个测试类进行测试。 package ex111; public class Violin { public String toString() { System.out.println(violin); return ; } } package ex111; public class Test_Main { public static void main(String[] args) { instrumentCellomodel = new instrumentCello(); instrumentViolinmodel1 = new instrumentViolin(); Cello cello = new Cello(); Violin violin = new Violin(); model.play(cello); mode

文档评论(0)

1亿VIP精品文档

相关文档