Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 27 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /