Question Error: object are not declared

Iswan

Member
Joined
Aug 9, 2011
Messages
8
Programming Experience
Beginner
Hai, i am creating project using Console Application . In this project i have class car and Module1. I also declared Public Color as string in Car class. In module1 i set the color property for this objectcar.The probleam is i still get an error Name 'red' is not declared. Please advice me, i also highlight line which give me this error.


Module Module1

Sub Main()
Dim objcar As New Car
objcar.Color = red
Console.WriteLine("My car is this color: ")
Console.WriteLine(objcar.color)

Console.ReadLine()
End Sub

End Module
 
If Color is type String then you should probably assign a String to it. You obviously know how to represent a String because you're doing it in the very next line.
 
Back
Top