Just to cover our bases, you already know that declaring a class and putting it in a particular namespace looks like Listing 2.1.
C#
namespace MyNamespace { public class Car { // class members } }
VB.NET
Namespace MyNamespace Public Class Car ' class members End Class End Namespace
We use namespaces because the .NET Framework is strongly typed. That means we give every class a fully qualified name to make sure that it's not duplicated and that there's no confusion about the class we're referencing. For example, both ASP.NET and Windows Forms have a TextBox class. The framework knows the difference because one lives in the System.Web.UI.WebControls namespace and the other in the System.Windows.Forms.Control namespace. We don't need to use its fully qualified name because we make using (Imports in VB.NET) declarations at the top of our code files so the compiler knows what we're talking about.