Chandubhoreddy,
You should research the topic of
"scope" in VB.NET
In this case you would want to specify that the subroutine "add" has a Public scope so that other code can call it.
You would define your subroutine as such:
-
Public Sub Add(ByVal x As Integer, ByVal y As Integer)
-
'do stuff
-
End Sub
-
Now you can call this code from a class that uses your object.
If you had defined your subroutine as:
-
Private Sub Add(ByVal x As Integer, ByVal y As Integer)
-
'do stuff
-
End Sub
-
Then you would not be able to call this code from outside of the object.
The "Public" and "Private" keywords are known as scope modifiers.
Scope is what lets you set the visibility (or accessibility) of variables, properties, functions, events, and subroutines....this ties into a much bigger topic of encapsulation and good software design but you should start by looking up scope.
-Frinny