Thread: Strange
View Single Post
Old 01-21-2013, 02:35 PM   PM User | #1
Zaid
New Coder

 
Join Date: Sep 2012
Location: Mumbai
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Zaid is an unknown quantity at this point
Question Strange

I have read that VB.NET is a fully Object-Oriented Compatible language....but to my amazement I have found out this code in a Console Application....

Code:
Imports System.Console
   Module Module1
      Sub Main()
          WriteLine("Hello from Visual Basic")
          ReadLine()
      End Sub
   End Module
Now how can we access WriteLine() and ReadLine() without creating the object of Console class(as we have only IMPORTED it, NOT INHERITED it), because in Java even if u import a class in a package(namespace here) u have to still instantiate(create object of) that class to access its members(data and methods).......I am still a beginner to the .NET world(as i am still learning Console Application )

Last edited by Zaid; 01-21-2013 at 02:36 PM.. Reason: Forgot the [CODE]tag
Zaid is offline   Reply With Quote