All pastes #927657 Raw Edit

Stuff

public text v1 · immutable
·published 2008-03-04 13:54 UTC
rendered paste body
Public Class Car
	Public colour As String
	Private _speed As Integer
	Private _numberofdoors As Integer

	Public Property numberofdoors()
		Get
			Return _numberofdoors
		End Get
		Set (ByVal value)
			If value >= 2 And value <= 5 Then
			_numberofdoors = value
		Else
			_numberofdoors = 5
		End Set
	End Property


Sub Main()
	Dim Objcar As New car
	Dim anothercar As New car
	objcar.colour = "blue"
	Console.WriteLine("my car is ")
	Console.WriteLine(objcar.colour)
	Console.ReadLine()
	objcar.accelerate(15)
	Console.WriteLine("my speed is ")
	Console.WriteLine(objcar.speed)
	Console.ReadLine()
	objcar.numberofdoors = "3"
	Console.WriteLine("Doors number is ")
	Console.WriteLine(objcar.numberofdoors)
	Console.ReadLine()