4 Private b
As Integer=30
6 Protected d
As Integer=50
7 Public Sub S1() ' All data members of the class should be accessible
11 Throw
New Exception("#A1-Accessibility:Failed-error accessing value of public data member frm same class")
14 Console
.WriteLine(e
.Message
)
19 Throw
New Exception("#A2-Accessibility:Failed-error accessing value of private data member from same class")
22 Console
.WriteLine(e
.Message
)
28 Throw
New Exception("#A3-Accessibility:Failed-error accessing value of friend data member from same class")
31 Console
.WriteLine(e
.Message
)
36 Throw
New Exception("#A4-Accessibility:Failed-error accessing value of protected data member from same class")
39 Console
.WriteLine(e
.Message
)
49 Public Sub DS1() 'All data members except private members should be accessible
52 Throw
New Exception("#A5-Accessibility:Failed-error accessing value of public data member from derived class")
55 Console
.WriteLine(e
.Message
)
60 Throw
New Exception("#A6-Accessibility:Failed-error accessing value of friend data member from derived class")
63 Console
.WriteLine(e
.Message
)
68 Throw
New Exception("#A7-Accessibility:Failed-error accessing value of protected data member from derived")
71 Console
.WriteLine(e
.Message
)
77 Public Sub S1() 'All public and friend members should be accessible
81 Throw
New Exception("#A8-Accessibility:Failed-error accessing value of public data member from another class")
84 Console
.WriteLine(e
.Message
)
89 Throw
New Exception("#A9-Accessibility:Failed-error accessing value of friend data member from another class")
92 Console
.WriteLine(e
.Message
)
103 Throw
New Exception("#A10-Accessibility:Failed-error accessing value of public data member form another module")
106 Console
.WriteLine(e
.Message
)