3 Fabulous Places To Visit In Legian Bali With Family

Legian is in the western part of Bali that is majorly known for a lot of unique and beautiful temples. There are a lot of different places to visit in Legian, Bali with family. It is famous for its…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Struct and Interface in Go

We use Interface to group a set of method. You can think it as a list that all structs that have implemented the required method. If you missing one of the method, you can not in that interface.

We can see that Student, Worker, Human all have implemented the Info method, so the variable i with type person interface will work well.

output:

But what if I change the Human method to Hi() ?

output :

If you have any problem, feel free to ask me !

Add a comment

Related posts:

4 Issues facing students today

Why do students find it so hard to read and develop their own thoughts on the material? This is something I’ve been thinking about lately and felt compelled to write about. I don’t have the answers…

This Tiny Electronic Dice Is Smaller Than the Ones in Your Yahtzee Box

Dice are probably the most common gaming devices in the world, and that’s because they’re remarkably good random number generators. True random number generation is essentially impossible, but dice…