内部类4

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

 

  @ expected

     匿名内部类(没有名字的内部类)

      JButton button = new JButton(“button”);

                  button.addActionListener(new ActionListener(){

                         public void actionPerformed(ActionEvent e){

                             System.out.println(“Button Clicked”);

                         }

                  });

    原文作者:sdjyfdg
    原文地址: https://blog.csdn.net/frdevolcqzyxynjds/article/details/84206803
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞