0
0

More than 1 year has passed since last update.

【C#】名前空間とは?

Last updated at Posted at 2022-11-22

一言で言うと

ファイルを整理する(見やすくする)為に、フォルダを分けること(本棚のようなもの)
プログラミング的にはクラスを種類ごとに分けて管理するためのもの。

   ①using System.Collections;
   ②using System.Collections.Generic;
   ③using UnityEngine;

初めから記載されているこれらは、名前空間である。
①②はC#の名前空間、③はunityの名前空間

ポイント
using=省略する

↓どちらも同じ意味

パターン1
System.Console.WritrLine("Hello World");

パターン2
using System;
Consol.WritrLine("Hello World");

インスタンス生成
名前空間.クラス 変数名 = new 名前空間.クラス();

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0