Skip to Content
Programming Visual Basic .NET
book

Programming Visual Basic .NET

by Dave Grundgeiger
December 2001
Beginner
464 pages
13h 51m
English
O'Reilly Media, Inc.
Content preview from Programming Visual Basic .NET

Identifiers

Identifiers are names given to namespaces (discussed later in this chapter), types (enumerations, structures, classes, standard modules, interfaces, and delegates), type members (methods, constructors, events, constants, fields, and properties), and variables. Identifiers must begin with either an alphabetic or underscore character ( _ ), may be of any length, and after the first character must consist of only alphanumeric and underscore characters. Namespace declarations may be declared either with identifiers or qualified identifiers . Qualified identifiers consist of two or more identifiers connected with the dot character ( . ). Only namespace declarations may use qualified identifiers.

Consider this code fragment:

Imports System

Namespace ORelly.ProgVBNet

   Public Class Hello
      Public Shared Sub SayHello(  )
         Console.WriteLine("hello, world")
      End Sub
   End Class

End Namespace

This code fragment declares three identifiers: OReilly.ProgVBNet (a namespace name), Hello (a class name), and SayHello (a method name). In addition to these, the code fragment uses three identifiers declared elsewhere: System (a namespace name), Console (a class name), and WriteLine (a method name).

Although Visual Basic .NET is not case sensitive, the case of identifiers is preserved when applications are compiled. When using Visual Basic .NET components from case-sensitive languages, the caller must use the appropriate case.

Ordinarily, identifiers may not match Visual Basic .NET keywords. If ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Visual Basic .NET, Second Edition

Programming Visual Basic .NET, Second Edition

Jesse Liberty

Publisher Resources

ISBN: 0596000936Supplemental ContentCatalog PageErrata