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. 【Effective Java】6、使用复合优先于使用继承

    这个,不管是什么书都会这样说,因为常常我们并不需要继承,而只是想把类进行一定的扩展,而我们想扩展的属性或方法对应的类都有,这个时候如果两者是is a的关系,这种关系是确实存在的,那么就可以使用继承,不 ...

  2. GJM :用JIRA管理你的项目(二)JIRA语言包支持及插件支持 [转载]

    感谢您的阅读.喜欢的.有用的就请大哥大嫂们高抬贵手"推荐一下"吧!你的精神支持是博主强大的写作动力以及转载收藏动力.欢迎转载! 版权声明:本文原创发表于 [请点击连接前往] ,未经 ...

  3. Comparable与Comparator的区别

    Java的Comparator和Comparable当需要排序的集合或数组不是单纯的数字型时,通常可以使用Comparator或Comparable,以简单的方式实现对象排序或自定义排序. 一.Com ...

  4. 如何让C#像JavaScript一样编程

    JavaScript是一门动态语言,可以动态的给对象添加属性和方法,非常方便.那么有没有一种方式可以让C#也具备动态添加属性和方法的能力,像Javascript一样进行编程? 下面就介绍一个很不错的框 ...

  5. bootstrap源码分析之tab(选项卡)

    实现tab选项卡的应用,此插件相对比较简单 源码文件: tab.js 实现原理 1.单击一个元素时,首先将原来高亮的元素取消2.然后给被单击元素进行高亮3.如果单击元素是下拉框中某个选项,则选中本身, ...

  6. 分享25个新鲜出炉的 Photoshop 高级教程

    网络上众多优秀的 Photoshop 实例教程是提高 Photoshop 技能的最佳学习途径.今天,我向大家分享25个新鲜出炉的 Photoshop 高级教程,提高你的设计技巧,制作时尚的图片效果.这 ...

  7. Tabio – 轻松,高效的管理 Chrome 标签页

    Tabio 是一个 Chrome 扩展,旨在简化大量浏览器标签页的管理.它提供的搜索功能允许您快速.轻松地找到您需要的选项卡.Tabio 便于组织你的标签,简单的拖拽排序.您也可以使用输入.删除和箭头 ...

  8. 计算DEM上的Profile图

    #!/usr/bin/env python # -*- coding: utf-8 -*- import sys, gdal, os from gdalconst import GA_ReadOnly ...

  9. 分位数(quantile)

    ---------------------------------------------------------------------------------------------------- ...

  10. SharePoint 2013 新建项目字段自动加载上次保存值

    1.点击进入NewForm.aspx页面,编辑页面,插入Script Editor WebPart,如下图: 2.插入后如下图,拖动AutoRecord WebPart到脚本编辑器上面,防止因为加载顺 ...