Home >>VB.Net Programs >VB.Net program to demonstrate the difference between Console.Write() and Console.WriteLine() methods
Here we will demonstrate the difference in VB.Net between the methods Console.Write() and Console.WriteLine().
To demonstrate the difference between the Console.Write() and Console.WriteLine() methods, we will create a VB.Net program.
Program
Below is the source code for explaining the difference between the methods Console.Write() and Console.WriteLine(). The program given is compiled and successfully executed.
Module Module1
Sub Main()
Console.WriteLine("This is Phptpoint")
Console.WriteLine("welcome to Phptpoint")
Console.Write("Hello welcome to my World")
Console.Write("This is My first line")
Console.ReadLine()
End Sub
End Module
Explanation:
Here, we built a module containing the method Main() and used the Console class methods Write() and WriteLine().
Console.WriteLine("This is Phptpoint") Console.WriteLine("welcome to Phptpoint")
Here on the console screen, we used the WriteLine() method message, the WriteLine() method to print newline characters to change the line.
Console.WriteLine("Hello welcome to my World") Console.WriteLine("This is My first line")
Here on the console screen, we used the Write() method message, where the Write() method does not print newline characters.