zoukankan      html  css  js  c++  java
  • 严格控制GOTO语句

    注意事项

    1,使用顺序、选择、循环等有限的基本结构表示程序逻辑。

    2,选用的控制结构只准许有一个入口和一个出口

    3,程序语句组成容易识别的块,每块只有一个入口和一个出口。

    4,复杂结构应该用基本控制结构进行组合或嵌套来实现。

    5,程序设计语言中没有的控制结构,可用一段等价的程序段模拟,但要求改程序段在整个系统中应前后一致。

    6,严格控制GOTO语句。

     1 package Com.TableTest;
     2 
     3 public class TableText_18 {
     4     public static void main(String[] args){
     5     new Person();
     6     new Man();
     7     
     8     }
     9 }
    10 class Person {
    11     public Person() {
    12          System.out.print("mother");
    13     }
    14 }
    15  
    16 class Man extends Person {
    17     public Man() {
    18          System.out.print("father");
    19     }
    20 }
  • 相关阅读:
    leetcode之String to Integer (atoi)
    初次思考
    leetcode之Reverse Words in a String
    Leetcode之Database篇
    在项目中添加类
    创建项目
    配置Eclipse

    递归
    多态
  • 原文地址:https://www.cnblogs.com/borter/p/9389456.html
Copyright © 2011-2022 走看看