下载此文档

Java试题及答案英文版.doc


文档分类:IT计算机 | 页数:约28页 举报非法文档有奖
1/28
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/28 下载此文档
文档列表 文档介绍
two demonstrate an “is a” relationship? (Choose Two)
A. public interface Person { }
public class Employee extends Person { }
B. public interface Shape { }
public class Employee extends Sha pe { }
C. public interface Color { }
public class Employee extends Color { }
D. public class Species { }
public class Animal{private Species species;}
E. ponent { }
Class Container ponent (
         ponent[ ] children;
Answer :de
2. Given:
1. package foo;
2. 
3. public class Outer (
4.    public static class Inner (
5.    )
6. )
Which statement is true?
A. An instance of the Inner class can be constructed with “new ()”
B. An instance of the inner class cannot be constructed outside of package foo
C. An instance of the inner class can only be constructed from within the outer class
D. From within the package bar, an instance of the inner class can be constructed with “new inner()”
Answer:c
:
1 public class enclosinggone{
2 public class insideone{}
3 }
4 public class inertest{
5 public static void main (String[] args){
6 enclosingone eo = new enclosingone();
7 //insert code here
8 }
}
Which statement at line 7 constructs an instance of the inner class?
InsideOne ei = InsideOne();
B. ei = InsideOne();
C InsideOne ei = InsideOne();
InsideOne ei = InsideOne();
Answer:a
4.
1) class Super{
2) public float getNum(){return ;}
3) }
4)
5) public class Sub extends Super{
6)
7) }
which method, placed at line 6, will cause piler error?
A. public float getNum(){return ;}
B. public void getNum(){}
C. public void getNum(double d){}
D. public double getNum(float d){return ;}
Answer :B
5.
1)public class Foo{
2) public static void main(String args[]){
3) try{return;}
4) finally{ ("Finally");}
5) }
6) }
what is the result?
A. The program runs and prints nothing.
B. The program runs and pri

Java试题及答案英文版 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数28
  • 收藏数0 收藏
  • 顶次数0
  • 上传人zxwziyou9
  • 文件大小74 KB
  • 时间2018-07-17