惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
C
Check Point Blog
I
InfoQ
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta
月光博客
月光博客
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tailwind CSS Blog
Y
Y Combinator Blog
博客园 - Franky
博客园_首页
罗磊的独立博客
量子位
美团技术团队
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Martin Fowler
Martin Fowler
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏

博客园 - 海盗

How to point your package manager to US server How to install Java in Ubuntu [Linux]Variable and Parameters in Bash - 海盗 HOWTO: Install chinese input One series article of Linux file system Reading notes of &lt;&gt; -- I <> - 海盗 - 博客园 Got two days' break New keyboard - 海盗 - 博客园 Some questions before learning ASP.net MVC framework Back again! JavaScript MD5 Encryption - 海盗 AJAX中的Back Button/Bookmarking问题和Nikhil Kothari的Atlas解决方案 My 50 favorite design resources 复杂域环境下通过.Net操作Active Directory经验点滴 IE ToolBar 关于namespace - 海盗 - 博客园 好久没来了! C#播放音乐
关于C#中字段的初始化
海盗 · 2006-06-08 · via 博客园 - 海盗

using System;

namespace Test
{
    
class Test
    
{
        
int x=0;
        
int y=x;  //出错!因为在y在初始化时要保证x已经存在,所以只能用static给类的字段初始化

        
public void Show()
        
{
            
int x=0;
            
int y=x+1;
        }


        
public static void Main()
        
{
        }

    }

}

这个比较匪夷一点

posted on 2006-06-08 17:55  海盗  阅读(768)  评论(0)    收藏  举报

刷新页面返回顶部