-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathch12.kt
71 lines (51 loc) · 1.2 KB
/
ch12.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/** Visibility Modifiers **/
/*
* private means visible inside this class only (including all its members)
* protected is the same as private but is also visible in subclasses.
* internal means that any client inside this module who see the declaring class sees its internal members
* public means that any client who sees the declaring class sees its public members
*/
/* open class Father6
{
//Properties
private var a:Int = 10
protected var b:Int = 20
internal var c:Int = 30
var d:Int = 40
var e:Int = 50
//Member function
fun disp()
{
println("A : $a")
println("B : $b")
println("C : $c")
println("D : $d")
println("E : $e")
}
fun hello()
{
println("Hello Father Python Programming language")
}
}
class Son6:Father6()
{
//Properties
var bike:String = "MT15"
//Member function
fun show()
{
/* println("A : $a") */
println("B : $b")
println("C : $c")
println("D : $d")
println("E : $e")
hello()
}
}
fun main()
{
val f1 = Son6()
f1.show()
f1.show()
}
*/