Java面向对程序设计测试试卷.docVIP

  • 5
  • 0
  • 约4千字
  • 约 7页
  • 2016-12-31 发布于贵州
  • 举报
阅读下面的程序代码,写出运行结果。(7*10=70分) 1、//Person.java public class Person { String song; String sport; void sing() { System.out.print(My favarate song is+ song); } void doSport() { System.out.print(My favarate sport is+ sport); } public static void main(String[] args) { Person p1=new Person(); p1.song=pop music; p1.sing(); } } 2. //Test1.java public class Test1 { public static void main(String[] args) { StaticA.f(); new StaticA().f(); } } class StaticA { static int count = 4 ; public static void f() { System.out.println(count++); } } 3. //Test2.java public cla

文档评论(0)

1亿VIP精品文档

相关文档