考虑这些类:
class Parent {
int a;
}
class Child extends Parent {
int a; // error?
}
Run Code Online (Sandbox Code Playgroud)
如果声明a中Child没有给出编译错误,由于多次声明int a?
WindowConstants 定义如下:
public interface WindowConstants
{
public static final int DO_NOTHING_ON_CLOSE = 0;
public static final int HIDE_ON_CLOSE = 1;
public static final int DISPOSE_ON_CLOSE = 2;
public static final int EXIT_ON_CLOSE = 3;
}
Run Code Online (Sandbox Code Playgroud)
JFrame 定义如下:
public class JFrame extends Frame implements WindowConstants,
Accessible,
RootPaneContainer,
TransferHandler.HasGetTransferHandler
{
/**
* The exit application default window close operation. If a window
* has this set as the close operation and is closed in an applet,
* a <code>SecurityException</code> may be thrown. …Run Code Online (Sandbox Code Playgroud)