Main.java:5: error: class Data is public, should be declared in a file named Data.java
可以告诉我一下这个报错怎么解决
关注
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率
已结题
关于#java#的问题:Main.java:5: error: class Data is public, should be declared in a file named Data.java
收起
- 写回答
- 好问题 0 提建议
- 关注问题
微信扫一扫点击复制链接分享
- 邀请回答
- 编辑 收藏 删除
- 收藏 举报
3条回答 默认 最新
- 关注
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率
_Onelone丶 2021-11-08 13:42关注是不是写了两个public class XXX{}
本回答被题主选为最佳回答 , 对您是否有帮助呢? 本回答被专家选为最佳回答 , 对您是否有帮助呢? 本回答被题主和专家选为最佳回答 , 对您是否有帮助呢?评论 打赏解决 1无用举报
微信扫一扫点击复制链接分享
评论按下Enter换行,Ctrl+Enter发表内容
报告相同问题?
提交
- 2020-03-05 08:59jay sun的博客 #Java Programming ##Chapter13 File Input and Output ###Understanidng Computer Files: Volatile storage is temporary. Random access memory (RAM) is a temporary storage. Nonvolatile storage is permanent...
- 2022-05-17 08:26wyb_Super的博客 Modulejava.base ...public final class System extends Object TheSystemclass contains several useful class fields and methods. It cannot be instantiated. Among the facilities provi...
- 2020-06-08 22:26Altoria7的博客 3.1 A Simple Java Program public class FirstSample { public static void main(String[] args) { System.out.println("We will not use 'Hello, World!'"); } } The keyword public is called an access ...
- 2020-06-14 01:28Altoria7的博客 Each object has a specific functionality, exposed to its users, and a hidden implementation Basically, as long as an object satisfies your specifications, you don't care how the functionality is
- 2022-01-09 17:01m0_51424656的博客 1.A Java exception is an instance of __________. 单选题 (2 分) E A.Exception B.RuntimeException C.Error D.NumberFormatException E.Throwable 3. Analyze the following code: class Test { public static ...
- 2022-01-09 13:05m0_51424656的博客 The java.lang.Number and its subclasses are introduced in Chapter 11. Analyze the following code. Number numberRef = new Integer(0...A.There is no such class named Integer. You should use the class In...
- 2019-03-24 06:39nshkfhwr的博客 参考网址:Java 基本数据类型 https://www.cnblogs.com/cisum/p/8006239.html 一、数据类型(Data Type) 1、基本数据类型 四类八种 1.1 整型(byte、short、Int、long、) 1.1.1 byte型 byte 数据类型是8位...
- 2023-09-11 13:41总是幸福的老豌豆的博客 汇总Java基础知识英语面试题
- 2023-09-11 12:58总是幸福的老豌豆的博客 汇总Java基础知识英语面试题。
- 2022-01-08 21:33m0_51424656的博客 An immutable class cannot have _______. C 单选题 (1 分) 1 分 A. static data fields B. no-arg constructors C. public data fields D. public constructors E. private data fields 2. A source code file may ...
- 2019-12-05 16:16谁还不是个孩子的博客 项目报错: Logging system failed to initialize using configuration from 'classpath:logging-...java.lang.IllegalStateException: Could not initialize Logback logging from classpath:logging-config.xm...
- 2021-02-28 12:27王润壮的博客 1)What is the output of running class Test?public classTest {public static voidmain(String[ ] args) {newCircle9();}}public abstract classGeometricObject {protectedGeometricObject() {System.out.print(...
- 2022-01-07 11:40Jornhitom的博客 1. syntax main() method public class Main { public static void main...Every line of code that runs in Java must be inside a class. In our example, we named the class Main. A class should always start wi
- 2022-01-08 15:50鹤纸千丶的博客 1. A method must declare to throw ________.... Error C. uncheckedexceptions D. RuntimeException 3. Suppose you enter 34.3 57.8 789, then press the ENTER key. Analyze the following code. ...
- 2020-10-30 23:22lang20150928的博客 文章目录系列文章目录前言 一、ServletContext接口概述 二、ServletContext接口作用域 三、初始化参数 四、配置方法 1、编程式添加和配置Servlet a. addServlet(servletName, className) b. addServlet(servletName,...
- 2018-10-15 12:50seconp的博客 官方英文介绍******************************************************************************************* ...JAR file is a file format based on the popular ZIP file format and is used for aggregat...
- 2016-11-06 21:48J_小浩子的博客 Six:Methods Item 38: Check parameters for validity Most methods and constructors have some restrictions on what values may be passed into their parameters. And constructors represent a special cas
- 2023-07-20 16:39十八年后又是的博客 OCP Java17 SE Developers 评估测试题
- 2018-01-29 22:25weixin_30521161的博客 1 """Lightweight XML support for Python. ... 3 XML is an inherently hierarchical data format, and the most natural way to 4 represent it is with a tree. This module has two classe...
- 2019-12-19 13:55Anghung的博客 JAVA代码规则对照表 Try-with-resources should be used 应该使用带有资源的Try-with-resources Creating cookies without the “secure” flag is security-sensitive 创建没有“secure”标志的cookie是安全敏感的 ...
- 没有解决我的问题, 去提问