Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (7k points)

I am new to Java and I would really like to have a much deeper understanding of what the  ActionnEvent e parameter means and stands for. When I code I don’t just want to spit out lines that will work, but I do not understand. I want to have a full understanding of concepts before I could use them.

What specifically is it asking for and what do parts mean?

class ButtonListener implements ActionListener{

        @Override

        public void actionPerformed(ActionEvent e){

    }

}

1 Answer

0 votes
by (13.1k points)

ActionEvent is a class, e is an instance of that class. YOu can use e to call its methods and properties that are found here in the official docs:

http://docs.oracle.com/javase/7/docs/api/java/awt/event/ActionEvent.html

ActionEvent is just a type and it informs you what type of object e is. By the way, you can change e to whatever you prefer, for ex. Event or object.

ActionEvent event, ActionEvent object, ActionEvent anyVariableName, etc..

Then inside actionPerformed() you can call stuff like event.doSomething();

Want to learn Java? Check out the Core Java certification from Intellipaat.

Related questions

0 votes
1 answer
asked Mar 22, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Feb 6, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Jan 25, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Jan 24, 2021 in Java by dante07 (13.1k points)

Browse Categories

...