小编sli*_*n13的帖子

谁能解释一下这是如何工作的?

我有这行代码.

class ButtonPanel extends JPanel implements ActionListener
{  
    public ButtonPanel()
    {  
        yellowButton = new JButton("Yellow");
Run Code Online (Sandbox Code Playgroud)

它工作,我认为Java在创建像这样的jButton实例之前需要知道yellowButton的类型?

JButton yellowButton = new JButton("Yellow");
Run Code Online (Sandbox Code Playgroud)

谁能解释一下这是如何工作的?

java swing scope initializing

4
推荐指数
1
解决办法
134
查看次数

标签 统计

initializing ×1

java ×1

scope ×1

swing ×1