How do you initialize an anonymous class in Java?

You can use the instance initialization section: new AbstractAction() { { //initialization code goes here } actionPerformed(ActionEvent event) { … } } Show activity on this post. Or you can just access the variables of the outer class from the inner class.

Sizin İçin Seçtik  Is low band 5G faster than 4G?

Leave a Reply

Your email address will not be published. Required fields are marked *