The public type classname must be defined in its own file

classname  为类名

错误提示,公用的类必髯有自己拥有独立.java文件

解决方法:

在工程中新建一份.java文件,然后把类重新定义为公用类public

解决方法2:

如果你的类只需用在当前,则可更改为私有类,即将public改为private

android The public type classname must be defined in its own file 报错的更多相关文章

  1. 调试记录:The public type <<classname>> must be defined in its own file

    (摘自stackoverflow) “The public type <<classname>> must be defined in its own file” error ...

  2. Java报错 -- The public type c must be defined in its own file

    出现The public type c must be defined in its own file这个问题,是由于定义的JAVA类同文件名不一致 你的文件里很可能有两个 public 的类,而Ja ...

  3. 【Junit】The import org.junit.Test conflicts with a type defined in the same file报错

    引入Junit后,进行单元测试,莫名其妙报了个这样的错误 The import org.junit.Test conflicts with a type defined in the same fil ...

  4. 解决 在Android开发上使用KSOAP2上传大图片到服务器经常报错的问题

    原文首发我的主力博客 http://anforen.com/wp/2017/04/android_ksoap2_unexpected_type_position_end_document_null_j ...

  5. Android调用 .Net Core WebApi 返回数据,用FastJSON解析一直报错。

    问题描述:.Net Core WebApi中用Newtonsoft.Json 把datatable转成json字符串,如:JsonConvert.SerializeObject(table,Forma ...

  6. Android 模糊搜索rawquery bind or column index out of range: handle 0x2fb180 报错

    做模糊搜索时,出现了  bind or column index out of range: handle 0x2fb180 报错 public Cursor getTitle(String word ...

  7. android studio 解析Excel数据格式导入poi-3.17.jar时的一系列报错及处理Failed resolution of: Ljavax/xml/stream/XMLEventFactory,duplicate entry: org/apache/xmlbeans/xml/stream/Location.class,GC overhead limit exceeded

    在org官网下载的poi jar包,导入到studio compile files('libs/poi-3.17.jar') compile files('libs/poi-ooxml-3.17.ja ...

  8. 宜立方商城中,mvn报错'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework:spring-webmvc:jar报错

    'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework:s ...

  9. Android 解决安装Egit时Egit Mylyn和org.eclipse.team.core报错

    为了让Aptana支持GitHub,需要安装Egit,但在的时候碰到两个错误,一个是关于缺少EGit Mylyn另一个是缺少org.eclipse.egit.import.feature.group. ...

随机推荐

  1. 利用PBFunc在Powerbuilder中支付宝当面付功能

    在PB实现支付宝当面付的功能,需要先在支付宝进行商户签约,并设置相关的公钥信息(具体参考支付宝文档). 然后使用对应的私钥文件对参数进RSAWithSha1前面计算.具体代码如下: string ls ...

  2. PHP storm快捷键

    左边文件路径看不到了,按alt+1就出来了 ctrl+j 插入活动代码提示 ctrl+alt+t 当前位置插入环绕代码 alt+insert 生成代码菜单 ctrl+q 查看代码注释 ctrl+d 复 ...

  3. C# Excel处理工具

    需求:选择一个Excel文件,然后对该Excel文件进行处理,再导出一个处理后的Excel文件. 效果图 声明:我对winform开发不熟,但是我看到许多开发人员做东西只管交差,从不考虑用户体验,也不 ...

  4. 七个结构模式之装饰者模式(Decorator Pattern)

    定义: 使用组合的方法,动态给一个类增加一些额外的功能,避免因为使用子类继承而导致类继承结构复杂.并且可以保持和被装饰者同一个抽象接口,从而使客户端透明. 结构图: Component:抽象构件类,定 ...

  5. ADO.NET(数据访问技术)

    简单的说,C#已经内置了一些类,我们可以利用这些类来访问数据库.在这里,我们假设读者已经熟悉SqlServer数据库或者其它数据库(我以后也会补上相关内容).我们如何来实现这项技术呢?大致可以分为三个 ...

  6. 玩转Docker之安装篇(二)

    按理说,安装软件最好是按照官方文档进行,但由于国内网络的局限性,使我们不得不搭梯子,但终究太麻烦.鉴于此情况,我推荐方案一,利用某公司的加速站点来安装,而且是傻瓜式的,非常方便. 方案一: 在linu ...

  7. clip-path

    html代码: <div> <img src="BC0C62C1B1962A8A.jpg"> </div> css代码: img{ clip-p ...

  8. Mysql一些复杂的语句

    1.查找重复的行 SELECT * FROM blog_user_relation a WHERE (a.account_instance_id,a.follow_account_instance_i ...

  9. 关于WPF中文件夹浏览对话框的方式

    文件夹浏览时dialogresult要写全引用路径 string path=null; FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd ...

  10. 图文详细解说DevExpress 2015新版亮点【附文档下载】

    历时两个月,翻译自官网的更新说明文档,最后整理成册,文末附PDF地址. DevExpress 在今年6月份发布了正式的2015版本,2015在旧版基础上有明显的升级改进,尤其是DevExtreme.W ...