谢谢大家了,明天去面试!1) Which of the following are legal statements?
1) float f=1/3;
2) int i=1/3;
3) float f=1.01;
4) double d=999d;2) Which of the following are Java keywords?
1) NULL
2) new
3) instanceOf
4) wend3) Which of the following are valid statements?
1) System.out.println(1+1);
2) int i=2+'2';
3) c
4) byte b=255;4) Which of the following statements are true?
1) The garbage collection algorithm in Java is vendor implemented
2) The size of primitives is platform dependent
3) The default type for a numerical literal with decimal component is a float.
4) You can modify the value in an Instance of the Integer class with the setValue method5) Which of the following are true statements?
1) I/O in Java can only be performed using the Listener classes
2) The RandomAccessFile class allows you to move directly to any point a file.
3) The creation of a named instance of the File class creates a matching file in the underlying operating system only when the close method is called.
4) The characteristics of an instance of the File class such as the directory separator, depend on the current underlying
operating system6).Which of the following statements are true?
1) The instanceof operator can be used to determine if a reference is an instance of a class, but not an interface.
2) The instanceof operator can be used to determine if a reference is an instance of a particular primitive wrapper class
3) The instanceof operator will only determine if a reference is an instance of a class immediately above in the hierarchy
but no further up the inheritance chain
4) The instanceof operator can be used to determine if one reference is of the same class as another reference thus7) Which of the following statements are true?
1) An interface can only contain method and not variables
2) Interfaces cannot have constructors
3) A class may extend only one other class and implement only one interface
4) Interfaces are the Java approach to addressing its lack of multiple inheritance, but require implementing classes to
create the functionality of the Interfaces.8) Which of the following are valid statements
1) public class MyCalc extends Math
2) Math.max(s);
3) Math.round(9.99,1);
4)Math.mod(4,10);9) Which of the following are methods of the Runnable interface
1) run
2) start
3) yield
4) stop10) Which of the following statements are true?
1) A byte can represent between -128 to 127
2) A byte can represent between -127 to 128
3) A byte can represent between -256 to 256
4) A char can represent between -2x2 pow 16 2 x2 pow 16 - 1

解决方案 »

  1.   

    谢谢,后面的呢!为什么第2题的NULL不是关键字,是因为大小写嘛?
      

  2.   

    偶也来试试:
    (1) 1 2
    (2) 2
    (3) 1 2
    (4) 1
    (5) 2 4
    (6) 2
    (7) 1 2 4
    (8) None
    (9) 1
    (10) 1
      

  3.   

    很谢谢你了,再问一下,真的是大小写的话,那第二题的instanceOf是不是也不改选呢?o是大写的啊。
      

  4.   

    说说偶的理由:
    (1) 1 2 4
    3:“1.01”默认是double,赋给float需要显式类型转换。(2) 2
    1:没有“NULL”,“null”是关键字;
    3:应该是“instanceof”,不是“instanceOf”。(3) 1 2
    4:范围超出了byte的-128~127了。(4) 1
    2:原始类型的字长是跨平台的;
    3:带小数点的数字文字常量默认是double类型,加后缀“f”才是float;
    4:原始类型的外覆类都是“常量”类,不能修改的。(5) 2 4
    1:不明白为什么这么说,Java I/O似乎跟Listener没有什么必然的联系吧;
    3:File对象未必真正对应一个实际的文件或目录,更没有什么close方法。(6) 2
    1:也可以用于判断所引用的对象是否实现出某个interface;
    3:可以用于对象跟任何类、接口之间的实例判断,大不了返回false就是了;
    4:intanceof不能用于判断两个对象是否属于同意类,只能用于判断某个引用所引用的对象是否属于某个类。(7) 1 2 4
    3:Interace可以实现多个接口;(8) None
    如果这道题里的Math指的不是java.lang.Math,那这道题偶认为就没任何意义了。如果是,那么
    1:Math是final类,不能被继承;
    2:Math没有一个参数的max方法;
    3:Math没有两个参数的round方法;
    4:Math没有mod方法;(9) 1(10) 1
    4:看了半天也没看懂,应该是:-(2 pow 15) to 2 pow 15 - 1
      

  5.   

    太谢谢你了,还说的这么详细,能说一下你的网上联系方法吗?以后还想请教你。不嫌烦的话在帮我看看后面的吧,呵呵,你做题好快啊。11) What will happen when you attempt to compile and run the following code
    class Base{
    public void Base(){
    System.out.println("Base");
    }
    }
    public class In extends Base{
    public static void main(String argv[]){
    In i=new In();
    }
    }
    1) Compile time error Base is a keyword
    2) Compilation and no output at runtime
    3) Output of Base
    4) Runtime error Base has no valid constructor12) You have a public class called myclass with the main method defined as follows
    public static void main(String parm[]){
    System.out.println(parm[0]);
    }
    If you attempt to compile the class and run the program as follows
    java myclass hello
    What will happen?
    1) Compile time error, main is not correctly defined
    2) Run time error, main is not correctly defined
    3) Compilation and output of java
    4) Compilation and output of hello13) Which of the following statements are true?
    1) If a class has any abstract methods it must be declared abstract itself.
    2) All methods in an abstract class must be declared as abstract
    3) When applied to a class, the final modifier means it cannot be sub-classed
    4) transient and volatile are Java modifiers14) Which of the following are valid methods?
    1) public static native void amethod(){}
    2) public static void amethod(){}
    3) private protected void amethod(){}
    4) static native void amethod();15) Which of the following statements are true?
    1) Constructors cannot have a visibility modifier
    2) Constructors can be ed public and protected, but not private
    3) Constructors can only have a primitive return type
    4) Constructors are not inherited16) What will happen when you attempt to compile and run the following class?
    class Base{
    Base(int i){
    System.out.println("Base");
    }
    }
    class Severn extends Base{
    public static void main(String argv[]){
    Severn s = new Severn();
    }
    void Severn(){
    System.out.println("Severn");
    }
    }
    1) Compilation and output of the string "Severn" at runtime
    2) Compile time error
    3) Compilation and no output at runtime
    4) Compilation and output of the string "Base"17) Which of the following statements are true?
    1) static methods do not have access to the implicit variable called this
    2) A static method may be called without creating an instance of its class
    3) A static method may not be overriden to be non-static
    4) A static method may not be overloaded18) Which of the following will compile without error?
    1)
    char c='1';
    System.out.println(c>>1);
    2)
    Integer i=Integer("1");
    System.out.println(i>>1);
    3)
    int i=1;
    System.out.println(i<<<1);
    4)
    int i=1;
    System.out.println(i<<1);19) Which of the following are true?
    1) A component may have only one event listener attached at a time
    2) An event listener may be removed from a component
    3) The ActionListener interface has no corresponding Adapter class
    4) The processing of an event listener requires a try/catch block20) Which of the following are Java keywords?
    1) sizeof
    2) main
    3) transient
    4) volatile