Question #131

Author: admin
tags: Go  
package main

import "fmt"

func main() {
	fmt.Println("main 1")
	defer fmt.Println("main 2")
	fmt.Println("main 3")
	defer fmt.Println("main 4")
}
In what order will the messages be displayed in the console?
main 1
main 2
main 3
main 4
main 1
main 3
main 4
main 2
main 1
main 3
main 2
main 4
main 2
main 4
main 1
main 3
Deferred functions are called in LIFO (last-in-first-out) order.
Rate the difficulty of the question:
easyhard