systemappsprogram.blogspot.com

VB.Net - Basic Syntax

VB.Net - Basic Entry Modules**//
 Imports System  
Public Class Rectangle
Related imagePrivate length As Double
Private width As Double 
'Public methods 
Public Sub 
AcceptDetails() 
length = 4.5 
width = 3.5
End Sub 
Public Function
GetArea() As Double GetArea = length * width End Function Public Sub Display() Console.WriteLine("Length: {0}", length) 
Console.WriteLine("Width: {0}", width) 
 Console.WriteLine("Area: {0}", GetArea()) 
End Sub 
 Shared Sub Main()
 Dim r As New Rectangle() r.Acceptdetails() r.
Display() Console.ReadLine()
 End Sub
 End Class 
Shared Sub Main() 
 Dim r As New Rectangle() 
 r.Acceptdetails() 
 r.Display() 
 Console.ReadLine()  
End Sub
  
Module DataTypes  
Sub Main() 
 Dim b As Byte  
Dim n As Integer 
 Dim si As Single 
 Dim d As Double  
Dim da As Date  
Dim c As Char  
Dim s As String
 Dim bl As Boolean 
b = 1 
 n = 1234567
  si = 0.12345678901234566 
d = 0.12345678901234566 
da = Today 
 c = "U"
 c s = "Me" 
 If ScriptEngine = "VB" 
 Then bl = True 
 Else bl = False  
End If  
If bl Then 
 'the oath taking Console.Write(c & " and," & s & vbCrLf) 
 Console.WriteLine("declaring on the day of: {0}", da) 
Console.WriteLine("We will learn VB.Net seriously") 
Console.WriteLine("Lets see what happens to the floating point variables:") 
Console.WriteLine("The Single: {0}, The Double: {1}", si, d) 
 End If
 Console.ReadKey()
 End Sub
 End Module
Share:

No comments:

Translate

Popular Posts

Recent Posts

Support System Software

Customer support is usually one of the key aspects for all companies, both small and large enterprises. Having a reliable customer support system will result in a positive image of your brand and will be a clear sing that you actually care about your clients and put effort into keeping them satisfied. Our team of SaaS experts have collected and tested all popular customer support software services currently available in the market. Our list should allow you to more easily decide which solution will work best for your business. Need our help to upload or customize this blogger template? Contact me with details about the theme customization you need.