我有這行代碼。有人可以解釋這是如何工作的?
class ButtonPanel extends JPanel implements ActionListener
{
public ButtonPanel()
{
yellowButton = new JButton("Yellow");
和它的作品,我認爲Java需要創建一個JButton這樣的一個實例之前需要了解yellowButton的類型?
JButton yellowButton = new JButton("Yellow");
有人可以解釋這是如何工作的?
你是對的,它被定義爲某處謝謝 – sliucon13 2011-06-10 18:43:05