} 运行结果: public class Test { public static void main(String[] args){ int i = 5; System.out.print(i++); System.out.print(i--); System.out.print(--i); System.out.print(i--); } } 运行结果: class A { double f(double x, double y) { return x * y; } } class B extends A { double f(double x, double y) { return x + y; } } public class Test { public static void main(String args[]) { B obj = new B(); System.out.println(\{=5644} {=The result is 10.0} } } 运行结果: class Father{ void printMe(){ System.out.println(\ } } class Son extends Father{ void printMe(){ System.out.println(\ } void printAll(){ super.printMe(); this.printMe(); printMe(); } } public class Test{ public static void main(String[] ars){ Son myC = new Son(); myC.printAll(); {=father son son } } } 运行结果: public class Test extends Father{ private String name=\ public static void main(String[] args){ Test test = new Test(); System.out.println(test.getName()); } } class Father{ private String name=\ public String getName() { return name; } } 运行结果: public class Demo{ public int add(int a,int b){ try{ return a+b; } catch(Exception e){ System.out.println(\语句块\ finally{ System.out.println(\语句块\{=father } {=finally 语句块 和是:43 } return 0; } public static void main(String[] args){ Demo demo = new Demo(); System.out.println(\和是:\ } } 运行结果: public class Father{ int b=10; public void plus(){ b++; } public static void main(String[] args){ Father x = new Father(); Son y = new Son(); System.out.println(y.b); System.out.println( y.getA()); y.miner(); System.out.println(y.b); System.out.println(y.getA()); } } class Son extends Father{ int b = 0; public void miner(){ b--; } public int getA() { return super.b; } {=0 10 -1 10 } } 运行结果: public class test { public static void main(String args[]) { String s1 = new String(\ String s2 = new String(\ boolean b1= s1.equals(s2); boolean b2 = s1== s2; System.out.print(b1+\ } } 运行结果: public class Test{ public static void main(String args[]) { Student s1= new Student(\ System.out.println(\ s1.print(); } } class Student { protected String name; protected char sex; protected int chinese; protected int english; {=true false} {=name sex chinese english Tom m 90 88}
java语言和www技术机考题资料(7)
2019-05-24 19:45
java语言和www技术机考题资料(7).doc
将本文的Word文档下载到电脑
下载失败或者文档不完整,请联系客服人员解决!