嵌套类型无法隐藏封闭类型 [英] nested type cannot hide an enclosing type

查看:1790
本文介绍了嵌套类型无法隐藏封闭类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个错误是什么意思?


嵌套类型HelloWorld无法隐藏封闭类型

The nested type HelloWorld cannot hide an enclosing type

HelloWorld是java文件名。如果需要,可以使用以下代码:

Where HelloWorld is the java file name. Here's the code if you need it:

import net.java.games.jogl.*;
public class HelloWorld
{ // open HelloWorld

    public class HelloWorld
    { // open HelloWorld

        public static void main (String args[])
        { // open main
            try
            { // open try
                System.loadLibrary("jogl");
                System.out.println("Hello World! (The native libraries are installed.)");
            } // close try
            catch (Exception e) // all try's need a catch
            { } // even if the catch does nothing
        } // close main

    } // close HelloWorld

);


推荐答案

您已经两次定义了HelloWorld类。删除一个级别你应该没事。

You have defined the HelloWorld class twice. Remove one level and you should be fine.

这篇关于嵌套类型无法隐藏封闭类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆