• Simple statements, blocks, Write, WriteLine and the format string.


            static void  SimpleProgram()
            // A block is a sequence of zero or more statements enclosed by a matching set of curly braces; it acts as a single syntactic statement.
            {
                //A statement is a source code instruction describing a type or telling the program to perform an action.
                int var1 = 5;
    
                //Write is a menber of the Console class. It sends a text string to the program's console window.
                System.Console.Write("This is trival text.");
    
                //WriteLine is another member of Console, which performs the same functions as Write but appends a newline character to the end of each output string.
                System.Console.WriteLine("The value of var1 is {0}", var1); 
    
                //The first parameter must always be a string and is called the format string.
                //The format string can contain substitution markers
                //A substitution marker marks the position in the format string where a value should be substituted in the output string.
                //It consists of an integer enclosed in a set of matching curly braces. The integer is the numeric position of the substitution value to be used.
                //The parameters following the format string are called substitution values. These substitution values are numbered, starting at 0.
                System.Console.WriteLine("Two sample integers are {1}, {0} and {1}.", 3, 6);
    
                //A marker must not attempt to referrence a value at a position beyond the length of the list of substition values. 
                //If it does, it will not produce a compile error but a runtime error (called an exception).
            }
  • 相关阅读:
    Servlet3.0之五:servlet3.0下的web.xml
    RESTLET开发实例(二)使用Component、Application的REST服务
    并发容器之ConcurrentLinkedDeque
    script的onerror事件支持情况调查
    纯CSS后台框架
    浏览器对width与height的最大值限制
    DOM系统中的各种队列
    跨域的异步请求四
    JSON parse在各浏览器的兼容性列表
    在IE6~8下创建HTML5新标签
  • 原文地址:https://www.cnblogs.com/limeina/p/3520789.html
Copyright © 2020-2023  润新知