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.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

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

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay