软件工程师笔试试题(Java).docVIP

  • 11
  • 0
  • 约2.68万字
  • 约 40页
  • 2019-01-07 发布于浙江
  • 举报
软件工程师笔试试题(JAVA) 填空题 (10分) 执行下列代码后的结果是什么? int x,a=2,b=3,c=4; x=++a+b+++c++; 包包含了Collection的接口和类的API main方法的声明格式包括 下列程序中构造了一个SET并且调用其方法add(),输出结果是 public class A{ public int hashCode(){return 1;} public Boolean equals(Object b){return true} public static void main(String args[]){ Set set=new HashSet(); set.add(new A()); set.add(new A()); set.add(new A()); System.out.println(set.size()); } } 下列程序的运行结果是 class A{ class Dog{   private String name;   private int age;   public int step;   Dog(String s,int a) { name=s; age=a; step=0;   }   public void run(Dog fast) { fast.step++;   } }   public static void main (String args[]){   A a=new A();   Dog d=a.new Dog(Tom,3);   d.step=25;   d.run(d);   System.out.println(d.step);   } } 选择题 (20分) 欲构造ArrayList类的一个实例,此类继承了List接口,下列哪个方法是正确的? A ArrayList myList=new Object(); B List myList=new ArrayList(); C ArrayList myList=new List(); D List myList=new List(); paint()方法使用哪种类型的参数? A Graphics B Graphics2D C String D Color 指出正确的表达式 A byte=128; B Boolean=null; C long l=0xfffL; D double=0.9239d; 指出下列程序运行的结果 public class Example{   String str=new String(good);   char[]ch={a,b,c};   public static void main(String args[]){     Example ex=new Example();     ex.change(ex.str,ex.ch);     System.out.print(ex.str+ and );     Sytem.out.print(ex.ch);   }   public void change(String str,char ch[]){     str=test ok;     ch[0]=g;   } } A good and abc B good and gbc C test ok and abc D test ok and gbc 要从文件 file.dat文件中读出第10个字节到变量C中,下列哪个方法适合? A FileInputStream in=new FileInputStream(file.dat); in.skip(9); int c=in.read(); B FileInputStream in=new FileInputStream(file.dat); in.skip(10); int c=in.read(); C FileInputStream in=new FileInputStream(file.dat); int c=in.read(); D RandomAccessFile in=new RandomAccessFile(file.dat); in.skip(9); int c=in.readByte(); 容器被重新设置大小后,哪种布局管理器的容器中的组件大

文档评论(0)

1亿VIP精品文档

相关文档