请提供以下错误的含义

编程入门 行业动态 更新时间:2024-10-22 07:16:49
本文介绍了请提供以下错误的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

public class Test9 //在这里收到错误 { public static void run() { System.out.println(运行中); } public static void fly() { System.out.println(飞行中); } } 公共类GoodDeveloper { public static void main(String [] args){ Test9.run( ); Test9.fly(); } } 我尝试了什么: 在上面的注释行我我得到的错误如公共类型Test9必须在其自己的文件中定义。请建议此错误的含义(但我知道解决方案。即删除公众) 请告诉我为什么我不能将我的课程设为公共

public class Test9 // getting error here { public static void run() { System.out.println("In run"); } public static void fly() { System.out.println("In fly"); } } public class GoodDeveloper { public static void main(String[] args) { Test9.run(); Test9.fly(); } } What I have tried: in the above commented line I am getting error like "the public type Test9 must be defined in its own file. Please suggest the meaning of this error( however i know the solution. i.e. removing public) Please tell me why I cannot make my class as public

推荐答案

你在同一个源文件中定义了多个公共类。不允许的。 / ravi You've defined more than one public class in the same source file. Java doesn't permit that. /ravi

更多推荐

请提供以下错误的含义

本文发布于:2023-11-11 07:06:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577723.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:含义   错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!