1、正确啊,那是两个整型数的按位与运算。
2、不可以,3是int型的,将高精度的类型赋值给低精度应该强制转换,t.test((short)3)
3、意思是String对象的+运算符被重载了,可以像整型数的+一样运算。
4、只要抛出的异常是所捕获异常的子类就匹配成功而忽略其它的catch语句。
5、匿名类也可以在方法调用时创建:
Button ok=new Button("ok");
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//...
}
});
不一定是在方法体里面。

解决方案 »

  1.   

    1.表达式合法:100&101=100;
    2.不可以.3为int;
    3.在java中只有+,+=被String重载;
    4.如IOException在前,则捕获;Exception 在前,compile error;
    5.not only;
    一起学习!
      

  2.   

    Exception 在前,compile error为什么,Exception
    不是IOException 的父类吗?
      

  3.   

    出错信息是IOException已经捕获了。
      

  4.   

    4.不会编译错误 IOException 将被 作为 Exception 捕捉
      

  5.   

    5)  这句话错在那里?
    An anonymous class can only be created within the body of amethod.anonymous类还可以在静态初始化块/非静态初始化块
    等地方被调用,如:class Other{
        void f555(){
           System.out.println("555");
       }
    }public class Test{
        {
    new Other(){
    void f555(){
                    System.out.println("555_0");
    }
    }.f555();  
    }
    static {
    new Other(){
    void f555(){
                    System.out.println("555_1");
    }
    }.f555();  
    }

       public static void main (String args[]){
       Test test=new Test();
       }
    }
      

  6.   

    1)  (4&5)这个表达式合法吗?答案说是合法的,为什么?   (按位运算,注意不是”与“)2)  定义一个方法是void test(shot c);     (JAVA中,整数值缺省是int)
    用t.test(3)调用时可以吗?答案说不可以。我觉得3是short类型吧。
    3)  这句话是什么意思?                   (只有string类重栽了+和+=,其余的类都没有,不能这样运算)
    only + and += are overloaded for string objects.
    4)  如果抛也一个IOException ,同时有两个catch,一个是IOException,另一个是Exception,那么抛出的例外被那个catch到呢? (看哪个在前面,合理的捕捉方法是子类在前面)
    5)  这句话错在那里?
    An anonymous class can only be created within the body of amethod.
    (匿名类也可以在初始化块里创建)