global::

  • Thread starter Thread starter Marc
  • Start date Start date
M

Marc

What's the meaning of global:: in the following statement

global::System.Data.DataTable employee = new DataTable("Employee");
My best guess is that it means the global namespace. But searching on
'global' gives a lot of non relevant entries.
 
Marc said:
What's the meaning of global:: in the following statement

global::System.Data.DataTable employee = new DataTable("Employee");
My best guess is that it means the global namespace. But searching on
'global' gives a lot of non relevant entries.

You'll usually see this in generated code. "global::" is just a way of
saying you want to start name resolution from the root. This would be
necessary, for example, if declared a nested namespace "System" of your own.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top