[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fTa8aEbQC4JyA16SkXbniinx3BlySNG_GyCWzifVworo":3},{"answer":4,"createTime":5,"id":6,"options":7,"origin":8,"question":12,"related":13,"source":19,"type":61},[],"2026-05-19 04:06:09",376868112,[],{"courseId":9,"courseImg":10,"courseName":11},"0ace1621ce7a5b2ac5f3473b7031ac9e","https:\u002F\u002Ftihai-oss-cloud.itihey.com\u002Fimg\u002F6d0846c25381bae4f747e249d16c8f3b.png","面向对象程序设计（Java）","定义一个接口,接口中有3个抽象方法如下. (1)&quot;long fact(int m);&quot;方法的功能为求参数的阶乘. (2)&quot;long intPower(int m,int n);&quot;方法的功能为求参数m的n次方. (3)&quot;boolean findFactor(int m,int n);&quot;方法的功能为判断参数m加上参数n的和是否大于100. 定义类实现该接口,编写应用程序,调用接口中的3个方法,并将调用方法所得的结果输出",[14,21,26,31,36,41,46,51,56,62],{"answer":15,"createTime":5,"id":16,"options":17,"question":18,"source":19,"type":20},[],376868103,[],"读下面程序,写出程序运行结果. class Father { int num1=0; public Father(){ System.out.println(&quot;num1:&quot;+num1);} public Father(int num1){ this.num1=num1; System.out.println(&quot;num1:&quot;+num1); } } class Son extends Father{ int num2=10; public Son(){System.out.println(&quot;num2:&quot;+num2);} public Son(int i,int j){ super(i); num2=j; System.out.println( &quot;num1:&quot;+num1+&quot;,num2:&quot;+num2); } } public class Demo{ public static void main(String []args){ Father father=new Father(); Son son=new Son(); Son son1=new Son(20,30); } } 运行结果为","v1",2,{"answer":22,"createTime":5,"id":23,"options":24,"question":25,"source":19,"type":20},[],376868104,[],"在(1)~(3)处填上适当的语句,使程序能正常运行 class Person { public void show(){} } (1) { public void show(){ System.out.println(&quot;Student&quot;);} } class Teacher extends Person{ (2) { System.out.println(&quot;Teacher&quot;);}} public class Demo{ public static void main(String []args){ (3) p.show(); p=new Student(); p.show(); p=new Teacher(); p.show(); }}",{"answer":27,"createTime":5,"id":28,"options":29,"question":30,"source":19,"type":20},[],376868105,[],"读下面程序,写出程序运行结果. class Point{ int x; public Point(){x=0;} public Point(int x){this.x=x;} public void show(){System.out.println(x);}} class SPoint extends Point{ int y; public SPoint(){y=0;} public SPoint(int x,int y){super(x); this.y=y;} public void show(){System.out.println(x+&quot;,&quot;+y);}} public class tempDemo{ public static void main(String []args){ Point p=new Point(); p.show(); Point p1=new Point(2); p1.show(); SPoint sp=new SPoint(); sp.show(); SPoint sp1=new SPoint(2,3); sp1.show(); }} 运行结果为",{"answer":32,"createTime":5,"id":33,"options":34,"question":35,"source":19,"type":20},[],376868106,[],"读下面程序,写出程序运行结果. class Point{ int x=1; public void show(){System.out.println(x);}} class SPoint extends Point{ int y=2; public void show(){System.out.println(x+&quot;,&quot;+y);}} class PPoint extends Point{ int z=3; public void show(){System.out.println(x+&quot;,&quot;+z);}} public class tempDemo{ public static void main(String []args){ Point p; p=new Point(); p.show(); p=new SPoint(); p.show(); p.x=2; p.show(); p=new PPoint(); p.show(); }} 运行结果为",{"answer":37,"createTime":5,"id":38,"options":39,"question":40,"source":19,"type":20},[],376868107,[],"在(1)~(3)处填上适当的语句,使程序能正常运行.. (1) class Employee { public abstract void show(); } class SalEmp extends Employee{ public void show(){System.out.println(&quot;SalEmp&quot;);} } class TelEmp extends Employee { (2) { System.out.println(&quot;TelEmp &quot;);} } public class Demo{ public static void main(String []args){ SalEmp p=new SalEmp(); p.show(); (3) p1=new TelEmp (); p1.show(); }}",{"answer":42,"createTime":5,"id":43,"options":44,"question":45,"source":19,"type":20},[],376868108,[],"读下面程序,写出程序运行结果. class Person{ int a,b; public Person(int a,int b){ System.out.println(&quot;a,b:&quot;+a+b); }} class Student extends Person{ int c; public Student(int a,int b,int c){ super(a,b); this.c= c; System.out.println(&quot;c:&quot;+c); } public void show(){ System.out.println(&quot;a,b,c:&quot;+a+b+c); }} public class classDemo1{ public static void main(String []args){ Person p1=new Person(1,2); Student p2=new Student(2,3,4); p2.show(); }} 运行结果为",{"answer":47,"createTime":5,"id":48,"options":49,"question":50,"source":19,"type":20},[],376868109,[],"读下面程序,写出程序运行结果. abstract class Graph{ int a; public Graph(){a=1;} public Graph(int a){this.a=a; } public abstract void showArea(); } class Rect extends Graph{ int b; public Rect(int a,int b){super(a); this.b= b; } public void showArea(){ System.out.println(&quot;Area:&quot;+(a*b));} } class Circle extends Graph{ public Circle(){}; public Circle(int a){super(a);} public void showArea(){ System.out.println(&quot;Area:&quot;+(3.14*a*a)); } } public class classDemo1{ public static void main(String []args){ Graph g1; g1=new Rect(2,3); g1.showArea(); g1=new Circle(2); g1.showArea(); g1= new Circle(); g1.showArea(); } } 运行结果为",{"answer":52,"createTime":5,"id":53,"options":54,"question":55,"source":19,"type":20},[],376868110,[],"在(1)~(3)处填上适当的语句,使程序能正常运行.. abstract class Person { public (1) show(); } class Student extends Person{ public (2) { System.out.println(&quot;Student&quot;);}} (3) { public void show(){ System.out.println(&quot;Teacher&quot;);}} public class Demo{ public static void main(String []args){ Person p; p=new Student(); p.show(); p=new Teacher(); p.show(); }}",{"answer":57,"createTime":5,"id":58,"options":59,"question":60,"source":19,"type":61},[],376868111,[],"按要求编写一个Java应用程序: (1)定义一个接口CanCry,描述会吼叫的方法public void cry(). (2)分别定义狗类(Dog)和猫类(Cat),实现CanCry接口.实现方法的功能分别为:打印输出&quot;我是狗,我的叫声是汪汪汪&quot;、&quot;我是猫,我的叫声是喵喵喵&quot;. (3)定义一个主类G, ①定义一个void makeCry(CanCry c)方法,其中让会吼叫的事物吼叫. ②在main方法中创建狗类对象(dog)、猫类对象(cat)、G类对象(g),用g调用makecry方法,让狗和猫吼叫",4,{"answer":63,"createTime":5,"id":6,"options":64,"question":12,"source":19,"type":61},[],[]]