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  Can you write a backend in Python?

Leave a Reply

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