Conflict name name import new package (java)

First of all, I'm new to java, so my question might be dumb, but I still need an answer :)

I have a class that handles a mapping. I called it "Display", but the problem is this: I need to import the org.lwjgl.opengl.Display class.

Of course, I have this error in my Display class statement:

A “display” is already defined in this compilation unit

And, of course, I can rename my class, but I would like to make sure that there is no way to easily get around this problem.

In the general case (since using a game library like LWJGL, I think I will have a lot of this), is it better to prefix my entire class to avoid a similar label?

Refresh . The class is already in the package.

package Graphics;

import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

public class Display { ... }

Thanx.

+5
2

, , , - ,

org.lwjgl.opengl.Display display = new org.lwjgl.opengl.Display().

, , .

+19

, java . . - .

public class Foo {

private static class Display {...}

}

.

0

All Articles