< METHOD_NAME>的类型是错误的 [英] The type of <METHOD_NAME> is erroneous

查看:119
本文介绍了< METHOD_NAME>的类型是错误的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Netbeans中遇到一个奇怪的编译错误。

I am getting a strange compile error in Netbeans.

我正在创建一个Experiment对象并在其上调用run方法。

I am creating an Experiment object and calling a run method on it.

    Experiment experiment=new Experiment();

    Result result = experiment.run(t, steps, trials, breadth, depth, seed, distribution);

编译器抱怨


运行类型(Maplayout,int,int,int,int,long,int)是
错误。

The type of run(Maplayout, int, int , int, int, long, int) is erroneous.

我的方法签名看起来很正常:

My method signature looks normal :

public Result run(MapLayout t, int steps, int trials, 
                        int breadth, int depth, long seed, int distribution)

我已经仔细检查过我的参数传入,他们似乎都很正常。如果我传入:

I have double checked the paramaters I am passing in and they all seem normal. If I pass in :

    experiment.run(null, 1,1,1,1,1l,1);

我在run方法上遇到相同的编译错误。

I get the same compile error on the run method.

我错过了一些明显的东西吗?有太多的Javascript损坏了我的大脑吗?

Am i missing something obvious? Has too much Javascript damaged my brain?

推荐答案

我遇到了同样的问题,解决方案在我的案例中非常简单。

I had the same issue and the solution was very simple in my case.

案例:

我从我正在工作的项目包中的另一个项目中复制/粘贴一些类。

其中一些人有旧包声明,编译器没有抱怨(因为他的原因)。

当我使用返回类型的方法之一'错误的打包'类时出现这个错误。

(错误的类型)

The case:
I copy/paste some classes from another project in a package of the project i am working in.
Some of them had the old package declaration and the compiler didn't complained (for his reasons).
When i used a method with return type one of the 'wrong packaged' classes this error appeared.
(The Type of is erroneous)

解决方案

解决这个问题,我将包装声明改为正确的!

The solution
To solve the issue, I changed the package declaration to be the correct one!

这篇关于< METHOD_NAME>的类型是错误的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆