Visual Basic .NET Language Console Console.WriteLine()

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Dim x As Int32 = 128
Console.WriteLine(x) ' Variable '
Console.WriteLine(3) ' Integer '
Console.WriteLine(3.14159) ' Floating-point number '
Console.WriteLine("Hello, world") ' String '
Console.WriteLine(myObject) ' Outputs the value from calling myObject.ToString()

The Console.WriteLine() method will print the given argument(s) with a newline attached at the end. This will print any object supplied, including, but not limited to, strings, integers, variables, floating-point numbers.

When writing objects that are not explicitly called out by the various WriteLine overloads (that is, you are using the overload that expects a value of type Object, WriteLine will use the .ToString() method to generate a String to actually write. Your custom objects should OverRide the .ToString method and produce something more meaningful than the default implementation (which typically just writes the fully qualified type name).



Got any Visual Basic .NET Language Question?