DEV Community

Cover image for Namespace
umida5
umida5

Posted on

Namespace

                  Namespace
Enter fullscreen mode Exit fullscreen mode

Namespace - (nomlar maydoni) - bu sinflar,strukturalarni mantiqiy guruhlash uchun foydalanadi.U bilan kodni tartibga so'lish mumkin.Namespacelar katta loyihalarda juda yordam beradi.Classlarni ajratib, kodni osonlashtirib beradi.

namespace NamespaceNomi
{
// Sinflar, interfeyslar, strukturalar va boshqa elementlar
}

namespace Transportlar
{
    class Avtomobil
    {
        public string model;
        public void Yurish()
        {
            Console.WriteLine(model + " harakatlanmoqda.");
        }
    }

    class Mototsikl
    {
        public string model;
        public void Yurish()
        {
            Console.WriteLine(model + " tez harakatlanmoqda.");
        }
        }
}

namespace Ishchilar
{
    class Haydovchi
    {
        public string ism;
        public void Haydash()
        {
            Console.WriteLine(ism + " mashina haydayapti.");
        }
    }
}
Enter fullscreen mode Exit fullscreen mode
  • bu kodda namespace ni qanday qilib ishlatish kerak bo'lgani ko'rsatilgan.

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs