is alread defined as class

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了is alread defined as class相关的知识,希望对你有一定的参考价值。

参考技术A 现象:

idea新建的module,里面按sbt的目录结构新建目录,然后在src/main/scala目录下跑最简单的HelloWold.scala都编译这个异常:

HelloWorld  is alread defined as class.

思考:

是不是object,class的区别没搞清楚,但是不至于编译报错。应该是idea找到了2个一样的结果。几次尝试,网上查资料。有的说是scala版本问题,有的说是module设置问题。

解决:

projectStructure---->project settings ---->Modules找到自己的modules,src不要重复标记了。只标记main作为sourcesFolders,test作为testSourceFolders.src就不要标记了

Swift Any、Type、is、as

参考技术A is , as , as? , as!
is: 判断是否为某种类型
as: 用来做强制转换

以上是关于is alread defined as class的主要内容,如果未能解决你的问题,请参考以下文章

Part of defining a topology is specifying for each bolt which streams it should receive as input(示例代

Hadoop常见问题2 Attempting to operate on hdfs namenode as root but there is no HDFS_NAMENODE_USER define

Hadoop常见问题2 Attempting to operate on hdfs namenode as root but there is no HDFS_NAMENODE_USER define

Hadoop常见问题2 Attempting to operate on hdfs namenode as root but there is no HDFS_NAMENODE_USER define

Hadoop常见问题2 Attempting to operate on hdfs namenode as root but there is no HDFS_NAMENODE_USER define

The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required .clas