Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Basics (Retired) Console I/O Namespaces

KARTIK BHASIN
KARTIK BHASIN
9,299 Points

How to figure out the namespace here?

What should be the correct answer to this quiz question. I thought that Illustrator should be the answer but it is not as it shows a bummer when I put any of the four choices among Adobe, Illustrator, Canvas, Paint in the blank space and submit answer.

2 Answers

Seth Reece
Seth Reece
32,867 Points

Hi Kartik,

In this case, Paint is the method, Canvas is the class, and Adobe.Illustrator is the namespace.

KARTIK BHASIN
KARTIK BHASIN
9,299 Points

Thanks for helping Seth, can u just help me in clarifying one thing, since Adobe is the name of an organisation so is it safe to assume that organisation name is included in the namespace name?. I mean here the namespace is Adobe.Illustrator and not Illustrator.

Seth Reece
Seth Reece
32,867 Points

Yes. If you look at the second example here, Adobe.Illustrator is the correct way to define a namespace. You could then have Adobe.Photoshop, Adobe.Acrobat etc. as namespaces.

Enrique Munguía
Enrique Munguía
14,311 Points

When you have an identifier built with several words you need to interpret them from right to left, lets say you have a method call

Foo.Bar.Baz.Boo()

The name with the parenthesis always is the method, and the method must be associated with a class. Both methods and classes names can contain only one word, so Boo is the method and Baz is the class, the rest must be the Namespace because Namespaces can be formed with several words separated by dots.

KARTIK BHASIN
KARTIK BHASIN
9,299 Points

Thanks a lot Enrique and Seth, the concept of naming namespaces became clear to me. Cheers!!