• week 4


    struct value type instantiated without new ctor must have para cant use default ctor class reference type struct implicitly sealed cant be inherited can be initiated only if field is const or static interface contain only function name no implementation. can override & member hiding abstruct class has limits interface often starts with capital I implementation written in class which use it abstruct class often is base class interface can be used in anywhere public void IStorable { void Read(); int Status {get;set;} } if you inherit it,you must implement it class can have more than one interface Public Class D:ISoreable,IDocumentable when we use it we should look up which methods must be implemented the interfaces being inherited by interface must also be implemented foreach(D d in folder) IStorable isD = d as IStorable left operand as right operand if interface hasnt be implemented isD=null multi inheritance forbidden multi interface allowed override interface polymorphism public void D{ public virtual void read(){} } public class Note:D{ public override void read(){} public void new store(){} } type safe classes Dictionary Array implementing IEnmunerable ICollection declare array type[]name automatically assigned to null foreach (Employee e in emp Array) { Console.Writeline(e.ToString()); } E []e={new E(1),new E(2)}; D(params int[]i) t.D(5,6,7,8); t.D(array); type[,]array=new[rows,cols]; type[,,]array=new[x,y,z]; c# should obey rows and columns jagged Array.Length get the number of rows jagged Array[x].Length get the number of x row yield return the next time it starts at where it was in the last time Dictionary if it cant find the word it may throw exception System.Text.StringBuilder builder add on the base StringLiteralOne"\\\\My" StringVerbatismLiteralOne@"\\My" StringLiteralOne"\n" StringVerbatismLiteralOne" "(true backspace) StringVerbatismLiteralOne@""v"" "v"
  • 相关阅读:
    python学习笔记(十一)处理json
    python学习笔记(十)常用模块
    python学习笔记(九)内置函数
    python学习笔记(八)函数return多个值,列表推导式和交换两个变量的值
    BZOJ 3675 [Apio2014]序列分割 (斜率优化DP)
    BZOJ 3126 [USACO2013 Open]Photo (单调队列优化DP)
    POJ 1821 Fence (单调队列优化DP)
    BZOJ 3326 [SCOI2013]数数 (数位DP)
    HDU 6148 Valley Numer (数位DP)
    BZOJ 2741 L (可持久化01Trie+分块)
  • 原文地址:https://www.cnblogs.com/itria/p/4388364.html
Copyright © 2020-2023  润新知