24.用break; return 方法。
23. class Cat{}
    class Dog extern Cat{}
     Dog adog = new Dog();
     if (adod instanceof Cat) {}
     if (Cat.isinstance(adog)) {}
22.ArrayList 和vector extern  AbstractList.   ArrayList 为固定容量,不能含有基本型别,可快速随即访问,为non-synchronized。Vector可自行扩张容量,为-synchronized。
21.List list = new ArrayList();
   for(int i = 0; i <10; i++)
   { list.add(new Integer(i));}
   Iterator e= list.iterator();
   while(e.hasNest())
     e.next.print();
20.List 以特定次序来持有元素,可有重复元素。Set 无法拥有重复元素,内部排序。Map 保存key-value值,value可多值。
19.Clone 有缺省行为,super.clone();他负责产生正确大小的空间,并逐位复制。
18.不可以,如果其中包含对象的method();不能保证对象初始化.
16.static i = 10; //常量
   class A a;  a.i =10;//可变
15.InputStream \ OutputStream;
14.overloading 用参数来辨别调用同名的函数,在多态中用到;overridding 重新更改其实现。在继承中用到。
13.后期绑定.
12.会。如:int i,i2;  return (i-i2);   //when i为足够大的正数,i2为足够大的负数。结果会造成溢位,导致错误。
11.访问reference 形成的网络,找出存活的对象。完成之后,释放不复存活的对象。
  可以。System.gc();
7.可以,
6.可以。必须只有一个类名与文件名相同。
5.System.gc();

解决方案 »

  1.   

    有点基础,没有j2ee的内容,建议加点j2ee的
      

  2.   

    6.好像应该是不能将某个类声明为public吧
      

  3.   

    大家帮我做道题啊 ,急死了Definition:
    &#8226; Variable: Begin with character set [‘a’ – ‘z’, ‘_’], variable can contain char set [‘a’ – ‘z’, ‘_’, ‘0’ – ‘9’]. Sensitive Case.
    &#8226; Constant: Only contain the char set [‘0’ – ‘9’], and range is 0 to 2147483647.
    &#8226; Assignment Expression: 
    o Assign constant to variable
    For example:
    A1 = 1;
    o Assign variable to variable
    For example:
    A1 = 1;
    A2 = 2;
    A1 = A2;
    o Assignment : ‘=’
    o Assignment separator: ‘;’
    &#8226; Error (the point ed by * is optional implementation)
    o Number format error
    For example: 
    A1 = 1a12;
    o Variable format error
    For example: 
    1A1 = 112;
    o Assignment expression format error
    For example: 
    A1 == 1a12;
    A1 = A2 = 112;o * Assignment separator expected
    For example: 
    A1 = 112
    o *Variable expected
    For example: 
    = 112;
    o *Constant expected
    For example: 
    A1 = ;
    o Assign error
    &#61607; No initial value 
    For example: 
    A1 = 1;
    A3 = A2;
    &#61607; Modify Constant 
    For example: 
    1 = A1;
    Input: 
    A text file contains a set of assignment expressions. 
    For example:
    A1 = 1;
    A2 = 2;
    A3 = 3;
    A2 = A3;
    A1 = 3;Output
    List all the variables that have the same value and list with their value together.
    For example:
    After process the above expressions, you need output the result like this:
    [A1, A2, A3] = 3;
    Requirement:
    &#8226; Design document (English only) is required. This document should write before you write any code.
    &#8226; Code should be consistent with java code convention.
    &#8226; Program can identify and handle all the errors in definition part.
    Test point:
    &#8226; Correctness
    o Identify all error in expression
    o Treat expressions correctly
    o Output correct result&#8226; Reliability 
    o Processing can not be interrupted by incorrect input or other reason
    o Heap will not overflow when big amount of expressions are processed&#8226; Performance
    o Amount of the expressions can be treated in 1 second&#8226; Memory 
    o Memory occupied when 100000 correct expressions are treated
      

  4.   

    题目是这样的 Definition:Variable: Begin with character set [‘a’ – ‘z’, ‘_’], variable can contain char set [‘a’ – ‘z’, ‘_’, ‘0’ – ‘9’]. Sensitive Case. 
    Constant: Only contain the char set [‘0’ – ‘9’], and range is 0 to 2147483647. 
    Assignment Expression: 
    Assign constant to variable 
    For example:A1 = 1;o       Assign variable to variableFor example:A1 = 1;A2 = 2;A1 = A2;Assignment : ‘=’ 
    Assignment separator: ‘;’ 
    Error (the point ed by * is optional implementation) 
    Number format error 
    For example:      A1 = 1a12;Variable format error 
    For example:      1A1 = 112;Assignment expression format error 
    For example:      A1 == 1a12;     A1 = A2 = 112; * Assignment separator expected 
    For example:      A1 = 112*Variable expected 
    For example:      = 112;*Constant expected 
    For example:      A1 = ;Assign error 
    No initial value 
    For example:      A1 = 1;     A3 = A2;Modify Constant 
    For example:      1 = A1;Input: A text file contains a set of assignment expressions. For example:            A1 = 1;            A2 = 2;            A3 = 3;            A2 = A3;            A1 = 3; Output
                List all the variables that have the same value and list with their value together.                        For example:                        After process the above expressions, you need output the result like this:                        [A1, A2, A3] = 3;  Requirement:Design document (English only) is required. This document should write before you write any code. 
    Code should be consistent with java code convention. 
    Program can identify and handle all the errors in definition part. 
      Test point:Correctness 
    Identify all error in expression 
    Treat expressions correctly 
    Output correct result 
     Reliability 
    Processing can not be interrupted by incorrect input or other reason 
    Heap will not overflow when big amount of expressions are processed 
     Performance 
    Amount of the expressions can be treated in 1 second 
     Memory 
    Memory occupied when 100000 correct expressions are treated. 
     
      

  5.   

    序列化
    import java.io.*;
    import java.util.*;public class Logon implements Serializable
    { private Date date = new Date();
    private String username;
    private transient String password; Logon (String name, String pwd)
    {
    username = name;
    password = pwd;
    }
    public String toString()
    {
    String pwd = (password == null) ? "(n/a)" : password;
    return "logon info: \n " + "username: " + username + "\n date: " + date + "\n password: " + pwd;
    } public static void main(String[] args) throws IOException, ClassNotFoundException
    {
    Logon a = new Logon("Morgan", "morgan83");
    System.out.println( "logon a =\n" + a);
    ObjectOutputStream o = new ObjectOutputStream(new FileOutputStream("Logon.out"));
    o.writeObject(a);
    o.close();
    System.out.println("========================================="); 
    int seconds = 5;
    long t = System.currentTimeMillis() + seconds * 1000;
    while(System.currentTimeMillis() < t);
    ObjectInputStream in = new ObjectInputStream( new FileInputStream("Logon.out"));
    System.out.println( "Recovering object at " + new Date());
    a = (Logon)in.readObject();
    System.out.println("logon a =\n" + a);  System.out.println(a.password); 
    }
    }
      

  6.   

    非常感谢楼上的,不过题目要求是有一个诸如
    A1=2;
    2A=343;
    A2=3;
    A5=2
    ...
    的赋值表达输入文件,要求你找出其中的错误,并且说明错误原因,最后将结果相同的输出
    形式如下
    [A1,A2...]=3
    麻烦你再做一下.不胜感激!
      

  7.   

    static怎么成常量了。那final有何用?
    高手也有低级错误的时候吗?
      

  8.   

    说得对。
    static final int i = 10;//拥有无法改变的存储空间。
      

  9.   

    ArrayList 为固定容量??
        /**
         * Increases the capacity of this <tt>ArrayList</tt> instance, if
         * necessary, to ensure  that it can hold at least the number of elements
         * specified by the minimum capacity argument. 
         *
         * @param   minCapacity   the desired minimum capacity.
         */
        public void ensureCapacity(int minCapacity) {
    modCount++;
    int oldCapacity = elementData.length;
    if (minCapacity > oldCapacity) {
        Object oldData[] = elementData;
        int newCapacity = (oldCapacity * 3)/2 + 1;
             if (newCapacity < minCapacity)
    newCapacity = minCapacity;
        elementData = new Object[newCapacity];
        System.arraycopy(oldData, 0, elementData, 0, size);
    }
        }
      

  10.   

    3. 用关键字final分别修饰类、方法、变量时,有何意义?修饰类,类不能被继承,修饰方法方法不可以被改变,修饰变量,变量值不能被改变!