Skip to content

Commit 309c15c

Browse files
author
mostafa
committed
inheritance
1 parent cc3a46d commit 309c15c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

oop/inheritance/inheritance.go

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package main
2+
3+
import "fmt"
4+
5+
type User struct {
6+
Name string
7+
}
8+
9+
type Employee struct {
10+
ID string
11+
User
12+
}
13+
14+
func main() {
15+
16+
u := User{
17+
Name: "kamal",
18+
}
19+
20+
e := Employee{
21+
"56",
22+
u,
23+
}
24+
25+
fmt.Println(e)
26+
27+
}

0 commit comments

Comments
 (0)