'This imports line isn't required because our main program right here
'and the World class are both in the same namespace. But it doesn't hurt
'to get used to defining your namespaces.
Imports VBTest.World
Module TalkToMeBaby
Sub Main()
Console.WriteLine("What's up fool. Talk to me baby.")
'This next line creates the variable blah with whatever the user types in the console.
Dim blah As String = Console.ReadLine()
'Let's create an instance of the World class.
Dim stuff As New World
'I could create another instance of World if I cared.
Dim otherStuff As New World
'Buuut it's useless for our purpose. This next line assigns a variable of our choice to the
'ArrayList type. Notice I did NOT create a new ArrayList.
Dim myToy As ArrayList
'Since I didn't create a new ArrayList, doing this:
'myToy.Add(blah)
'...would return a compiler error. So what CAN I do with it you ask? Watch.
'This next line calls the SayWorld function, and assigns the return ArrayList
'to myToy.
myToy = stuff.SayWorld(blah)
'Since myToy now actually points to a real instance of an ArrayList, we can
'get stuff from it. This next line gets the string from the ArrayList and
'assigns it to the string "result".
Dim result As String = CType(myToy(0), String)
'Print the string to the console. If the user typed "Hello", it will say "Hello
'World!" If not, it says "You suck!" This program IS case sensitive.
Console.WriteLine(result)
'Press any key to exit.
Console.ReadLine()
End Sub
End Module