Easy mistakes in c#

ACCESS MODIFIERS

c# has some access modifiers below:

public:class or member can be accessed by no restrictions

private:members can only be accessed within the class itself

internal:class or member can only be accessed within the assembly,not others.

protected:members can only be accessed by derived class(or within the class of course), not others non-derived class.

protected internal: members can only be accessed by derived class, OR, in the same assembly.

NOTE:

  1. not all access modifiers can be used on class,that‘s why there‘s underline on "class or member" and "members". it‘s nonsense to use private,protected,protected internal on a class. This may make mistake easily.
  2. no access modifier allowed on namespace,but public is implicitly.
  3. internal is default to a class
  4. no access modifier allowed on a interface but public is implicitly.
  5. private is default to members.

Modifiers and Static

Can not use override,virtual or abstract on a static member, cause these are for instance of inheriting

Size of basic types

type size(byte) size(bit) Range
 char  2  16  
   char    
   char    
   char    
时间: 2025-01-12 00:14:26

Easy mistakes in c#的相关文章

Yet Another 10 Common Mistakes Java Developers Make When Writing SQL (You Won’t BELIEVE the Last One)--reference

(Sorry for that click-bait heading. Couldn't resist ;-) ) We're on a mission. To teach you SQL. But mostly, we want to teach you how to appreciate SQL. You'll love it! Getting SQL right or wrong shouldn't be about that You're-Doing-It-Wrong? attitude

Top 10 Mistakes Java Developers Make--reference

This list summarizes the top 10 mistakes that Java developers frequently make. #1. Convert Array to ArrayList To convert an array to an ArrayList, developers often do this: List<String> list = Arrays.asList(arr); Arrays.asList() will return an Array

[转]50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs

http://devs.cloudimmunity.com/gotchas-and-common-mistakes-in-go-golang/ 50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs Go is a simple and fun language, but, like any other language, it has a few gotchas... Many of those gotc

10 Biggest Business Mistakes That Every Entrepreneur Should Avoid

原文链接:http://www.huffingtonpost.com/syed-balkhi/10-biggest-business-mista_b_7626978.html When I started my first business, I made a lot of mistakes (everyone does). While mistakes are unavoidable, you can use the lessons learned by others to prevent t

Make Interfaces Easy to Use Correctly and Hard to Use Incorrectly

Make Interfaces Easy to Use Correctly and Hard to Use Incorrectly Scott Meyers ONE OF THE MOST COMMON TASKS in software development is interface specification. Interfaces occur at the highest level of abstraction (user inter- faces), at the lowest (f

10 Easy Steps to a Complete Understanding of SQL

原文出处:http://tech.pro/tutorial/1555/10-easy-steps-to-a-complete-understanding-of-sql(已经失效,现在收集如下) Too many programmers think SQL is a bit of a beast. It is one of the few declarative languages out there, and as such, behaves in an entirely different w

地理数据可视化:Simple,Not Easy

如果要给2015年的地理信息行业打一个标签,地理大数据一定是其中之一.在信息技术飞速发展的今天,“大数据”作为一种潮流铺天盖地的席卷了各行各业,从央视的春运迁徙图到旅游热点预测,从大数据工程师奇货可居到马云布道“DT”时代,“大数据”被推到了一个前所未有的高度,连国家领导人出访演讲都言必称大数据.地理信息数据天生具有大数据属性,作为整天和地理信息数据打交道的地信人自然不甘落后,地理大数据概念脱颖而出. 地理大数据是什么?大体来说就是把社会经济.自然资源.商业信息等但凡具有一点空间维度的数据一股脑

哈理工2015暑假训练赛BNU16488 Easy Task(简单题)

A - Easy Task Time Limit:2000MS    Memory Limit:65536KB    64bit IO Format:%lld & %llu SubmitStatusPracticeZOJ 2969 Description Calculating the derivation of a polynomial is an easy task. Given a function f(x) , we use (f(x))' to denote its derivatio

New to Machine Learning? Avoid these three mistakes

http://blog.csdn.net/pipisorry/article/details/43973171 James Faghmous提醒机器学习初学者要避免的三方面错误,推荐阅读 New to Machine Learning? Avoid these three mistakes Common pitfalls when learning from data Machine learning (ML) is one of the hottest fields in data scien