+ 4

What is the difference between namespace and class in C#?

please help me thanks ;

25th Apr 2018, 3:01 PM
Masoud Rabiee
Masoud Rabiee - avatar
2 Respostas
+ 8
TurtleShell is correct. Namespaces are logical grouping for the Class in C#. For example, we can have Pikachu.cs class under Pokemon.Electric namespace while Charizard.cs for Pokemon.Fire. Hopefully it helps! 😉
25th Apr 2018, 3:18 PM
Zephyr Koo
Zephyr Koo - avatar
+ 3
Namespaces are used to group together classes, they are like packages in Java. For example you might be creating some maths classes which you could group into a myMaths namespace. Classes are the ‘blueprints’ for objects.
25th Apr 2018, 3:07 PM
TurtleShell
TurtleShell - avatar