简体   繁体   中英

eventqueue meaning of arrow

because I couldn't find anything in google that would explain that, I decided to turn myself to ask you what the arrow in this specific example does, I never saw that expression so I don't really get it what it does.

Site I try to learn from: http://zetcode.com/tutorials/javagamestutorial/basics/

Thanks for helping!~

   public static void main(String[] args) {

        EventQueue.invokeLater(() -> {
            Application ex = new Application();
            ex.setVisible(true);
        });
    }

It's part of a lambda expression , which is a shorthand for defining functions. This creates a class with a method that takes no arguments and executes the statement block.

() -> {
    Application ex = new Application();
    ex.setVisible(true);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM