(7-1)请阅读程序,并写出程序运行结果。 class X{ int getX() { return 5; } } class Y extends X{ int getX() { return 6; } } class T extends X{ int getX() { return 7; } } public class Demo10 { public static void main(String[] args) { X x=new X(); Y y=new Y(); X t=new T(); int sum=x.getX()+y.getX()+t.getX(); System.out.println(sum); } }
(7-1)请阅读程序,并写出程序运行结果。 class X{ int getX() { return 5; } } class Y extends X{ int getX() { return 6; } } class T extends X{ int getX() { return 7; } } public class Demo10 { public static void main(String[] args) { X x=new X(); Y y=new Y(); X t=new T(); int sum=x.getX()+y.getX()+t.getX(); System.out.println(sum); } }
以下的类(接口)定义中正确的是( ) A: public class A{ private int x; public getX(){ return x; }} B: public abstract class A{ private int x; public abstract int getX(); public int aMethod(){ return 0; }} C: public class A{ private int x; public abstract int getX();} D: public interface interfaceA{ private int x; public int getX(){ return x; }}
以下的类(接口)定义中正确的是( ) A: public class A{ private int x; public getX(){ return x; }} B: public abstract class A{ private int x; public abstract int getX(); public int aMethod(){ return 0; }} C: public class A{ private int x; public abstract int getX();} D: public interface interfaceA{ private int x; public int getX(){ return x; }}
有如下程序: #include<iostream> using namespace std; class XX{ int x; public: XX(int XX=0):x(xx){} int getX(){return x;} }; class YY:public XX{ int y; public: YY(int xx,int yy):XX(xx),y(yy){} int getV(){return getX()+y;} }; int main(){ YY c(3,4); cout<<c.getV()+c.getX()<<endl; return 0; } 运行这个程序的输出结果是______。 A: 3 B: 4 C: 7 D: 10
有如下程序: #include<iostream> using namespace std; class XX{ int x; public: XX(int XX=0):x(xx){} int getX(){return x;} }; class YY:public XX{ int y; public: YY(int xx,int yy):XX(xx),y(yy){} int getV(){return getX()+y;} }; int main(){ YY c(3,4); cout<<c.getV()+c.getX()<<endl; return 0; } 运行这个程序的输出结果是______。 A: 3 B: 4 C: 7 D: 10
在JSP中,给定以下JSP代码片段,运行结果是()。 <% int x=5; %> <%! int x=7; %> <%! int getX(){ return x; } %> <% out.print(“X1=”+x); %> <% out.print(“X2=”+getX()); %>
在JSP中,给定以下JSP代码片段,运行结果是()。 <% int x=5; %> <%! int x=7; %> <%! int getX(){ return x; } %> <% out.print(“X1=”+x); %> <% out.print(“X2=”+getX()); %>
(7-1)以下程序运行结果是()。 class FatherX{ public Integer getX() { return new Integer(10); } } class Son extends FatherX{ public Double getX() { return new Double(20); } } public class Demo12 { public static void main(String[] args) { FatherX f=new FatherX(); Son s=new Son(); System.out.println(f.getX()+s.getX()); } }
(7-1)以下程序运行结果是()。 class FatherX{ public Integer getX() { return new Integer(10); } } class Son extends FatherX{ public Double getX() { return new Double(20); } } public class Demo12 { public static void main(String[] args) { FatherX f=new FatherX(); Son s=new Son(); System.out.println(f.getX()+s.getX()); } }
(7-12)请阅读程序,写出程序运行结果。 class A{ static String name="tom"; static int getX() { return 2; } int getY() { return 3; } } class B extends A{ static String name="Tuny"; static int getX() { return 4; } int getY() { return 5; } } class C extends A{ static String name="Tuny"; static int getX() { return 4; } int getY() { return 5; } } interface D{ int getY(); } class E implements D{ public int getY() { return 6; } } public class Demo{ public static void main(String[] args) { A a=new A(); A b=new B(); A c=new C(); D d=new E(); int sum=a.name.length()+b.getX()+c.getY()+d.getY(); System.out.println(sum); } }
(7-12)请阅读程序,写出程序运行结果。 class A{ static String name="tom"; static int getX() { return 2; } int getY() { return 3; } } class B extends A{ static String name="Tuny"; static int getX() { return 4; } int getY() { return 5; } } class C extends A{ static String name="Tuny"; static int getX() { return 4; } int getY() { return 5; } } interface D{ int getY(); } class E implements D{ public int getY() { return 6; } } public class Demo{ public static void main(String[] args) { A a=new A(); A b=new B(); A c=new C(); D d=new E(); int sum=a.name.length()+b.getX()+c.getY()+d.getY(); System.out.println(sum); } }
以下C程序正确的运行结果是 。 main() { long y=-43456; printf ("y=%-8ld\n",y); printf ("y=%-08ld\n",y); printf ("y=%08ld\n",y); printf ("y=%+8ld\n",y); }: y=-43456 y=-43456 y=-0043456 y=+□-43456|y=-43456 y=-43456 y=-0043456 y=□□-43456|y=□□-43456 y=-0043456 y=00043456 y=+43456|y=□□-43456 y=-□□43456 y=-0043456 y=-43456
以下C程序正确的运行结果是 。 main() { long y=-43456; printf ("y=%-8ld\n",y); printf ("y=%-08ld\n",y); printf ("y=%08ld\n",y); printf ("y=%+8ld\n",y); }: y=-43456 y=-43456 y=-0043456 y=+□-43456|y=-43456 y=-43456 y=-0043456 y=□□-43456|y=□□-43456 y=-0043456 y=00043456 y=+43456|y=□□-43456 y=-□□43456 y=-0043456 y=-43456
以下C程序正确的运行结果是 。 main() { long y=-43456; printf ("y=%-8ld ",y); printf ("y=%-08ld ",y); printf ("y=%08ld ",y); printf ("y=%+8ld ",y); }: y=-43456 y=-43456 y=-0043456 y=+□-43456|y=-43456 y=-43456 y=-0043456 y=□□-43456|y=□□-43456 y=-0043456 y=00043456 y=+434
以下C程序正确的运行结果是 。 main() { long y=-43456; printf ("y=%-8ld ",y); printf ("y=%-08ld ",y); printf ("y=%08ld ",y); printf ("y=%+8ld ",y); }: y=-43456 y=-43456 y=-0043456 y=+□-43456|y=-43456 y=-43456 y=-0043456 y=□□-43456|y=□□-43456 y=-0043456 y=00043456 y=+434
函数y=x²-1的值域是( ) A: {y|y≥1} B: {y|y≥-1} C: {y|y≤1} D: {y|y≤-1}
函数y=x²-1的值域是( ) A: {y|y≥1} B: {y|y≥-1} C: {y|y≤1} D: {y|y≤-1}
已知点()(()-()1(),()y()1())(),()(2(),()y()2())(),()(()-()3(),()y()3())()都在函数()y()=()x()2()的图象上,则()()A.()y()1()<()y()2()<()y()3()B.()y()1()<()y()3()<()y()2()C.()y()3()<()y()2()<()y()1()D.()y()2()<()y()1()<()y()3
已知点()(()-()1(),()y()1())(),()(2(),()y()2())(),()(()-()3(),()y()3())()都在函数()y()=()x()2()的图象上,则()()A.()y()1()<()y()2()<()y()3()B.()y()1()<()y()3()<()y()2()C.()y()3()<()y()2()<()y()1()D.()y()2()<()y()1()<()y()3