就是正常以object我参数,调用一个方法就可以了! 我也不知道你什么不明白!

解决方案 »

  1.   

    test()方法里有这样一行代码:
    if(n instanceof obj)
    n是已经的对象;obj想作为一个参数传入;
    不知道怎样传?
      

  2.   

    test(Fly.class);
    这样传的话,编绎是可以通过,但好像没有执行test()里的代码.
      

  3.   

    我的意思是这样的:
    private void test(Object obj) {
        System.out.println(" ++++++++++++++++++ ");
    }
    main(String[] args) {
        test(Vector.class);
    }
    这行代码表示什么意思?
    编绎没有错误,但没有打印出任何东西.
    WHY?
      

  4.   

    private static void test(Object obj) {
        System.out.println(" ++++++++++++++++++ ");
    }
    main(String[] args) {
        test(Vector.class);
    }你的要求的确有点让人不明白,,,
      

  5.   

    你是要这样的效果吗
    private FlySon fly_son;
    private void test(Fly fly) {
        if(fly_son instanceof Fly) {
            ........................
        }
    }void call()
    {
    test(fly_son);
    }
      

  6.   

    改一下,呵呵 if(fly instanceof Fly),你可以传多个Fly的子类,