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

推荐订阅源

Engineering at Meta
Engineering at Meta
博客园_首页
H
Help Net Security
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
B
Blog
I
InfoQ
SecWiki News
SecWiki News
T
Tailwind CSS Blog
Spread Privacy
Spread Privacy
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
N
Netflix TechBlog - Medium
P
Palo Alto Networks Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Vercel News
Vercel News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
Kaspersky official blog
M
MIT News - Artificial intelligence
S
Schneier on Security
T
Threat Research - Cisco Blogs
F
Fortinet All Blogs
Cyberwarzone
Cyberwarzone
Scott Helme
Scott Helme
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
The Cloudflare Blog
Recent Announcements
Recent Announcements
Security Latest
Security Latest
G
GRAHAM CLULEY
IT之家
IT之家
Y
Y Combinator Blog
The Last Watchdog
The Last Watchdog
腾讯CDC
Google DeepMind News
Google DeepMind News
V
V2EX
S
Securelist
TaoSecurity Blog
TaoSecurity Blog
B
Blog RSS Feed
S
SegmentFault 最新的问题
博客园 - 叶小钗
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
Project Zero
Project Zero
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
F
Full Disclosure

博客园 - 张少峰

在linuxdeepin10.12下源码安装bochs-2.4.6 设置pppoe时遇到“Oh, dear, I don't see the file '/etc/ppp/pppoe.conf' anywhere.”时的解决方法 安装ubuntu10.10时遇到ubi partman crashed,ubi-partman failed with exit code 141的解决方案 糗事的教训:做事一定要细心细心再细心 Reflector插件FileDisassembler汉化修改版 解压用Sixxpack2.2压缩过的程序,拿原始程序集 - 张少峰 - 博客园 利用网页挂马拿服务器的一种设想 第一次上首页,发一个玩具级的持久化工具~ python一些细微的东西 IndentationError: unindent does not match any outer indentation level Request的几种路径属性 一个方法返回多个值的解决方法 用反射把程序集中一些泛型类实例化,怎么确定实例的类型? 父类实现IComparable<T>接口,子类无法使用~ [转载]谓词和操作(c#版) 静态变量的继承 XPath初学笔记(四) XPath初学笔记(三) XPath初学笔记(二)
值类型与引用类型
张少峰 · 2008-11-21 · via 博客园 - 张少峰

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    
class Program
    
{
        
static void Main(string[] args)
        
{
            
int a = 444;
            
//New一个列表
            List<int> ll = new List<int>();
            
//初始化列表数据,以便测试
            for (int i = 6; i >0; i--)
            
{
                ll.Add(i);
            }

            
//把a添加到列表最后
            ll.Add(a);
            
//输出
            Console.WriteLine("(改变a的值前)a=" + a);
            Console.Write(
"(改变a的值前)ll列表:");
            
foreach (int i in ll)
                Console.Write(i.ToString() 
+ ",");
            Console.WriteLine();
            
//改变a的值
            a = 2;
            
//输出
            Console.WriteLine("(改变a的值后)a=" + a);
            Console.Write(
"(改变a的值后)ll列表:");
            
foreach (int i in ll)
                Console.Write(i.ToString() 
+ ",");
            Console.WriteLine();

            List
<int> kk = new List<int>();
            kk 
= ll;
            kk.Add(
777);

            Console.Write(
"(给kk列表添加一个值后)ll列表:");
            
foreach (int i in ll)
                Console.Write(i.ToString() 
+ ",");
            Console.WriteLine();
            Console.Write(
"(给kk列表添加一个值后)kk列表:");
            
foreach (int i in kk)
                Console.Write(i.ToString() 
+ ",");
            Console.WriteLine();
            kk.Sort();
            Console.Write(
"(kk列表排序后)ll列表:");
            
foreach (int i in ll)
                Console.Write(i.ToString() 
+ ",");
            Console.WriteLine();
            Console.Write(
"(kk列表排序后)kk列表:");
            
foreach (int i in kk)
                Console.Write(i.ToString() 
+ ",");
            Console.WriteLine();
            Console.ReadKey();
        }

    }

}