• 第一个方法(初学)


    顺序结构 开始-代码一-代码二-代码三-结束
    判断语句:if(关系表达式){ 主体 }
    : if (关系表达式) { 主体 }else { 主体 }
    :if(关系表达式){ 主体} else if(主体) else()
    switch后面笑括号当中可以放的数据类型如下:byte short char int 字符串string
    enum 枚举

    switch匹配到哪一个case向下执行直到遇到break或者整体结束才结束.


    for(初始化表达式;布尔表达式;步进表达式;){循环体}
    while(布尔表达式){循环体 ,步进表达式}
    do{主体}while(布尔表达式)

    public class LuckenF{
      public static void main(String[] args){
        System.out.println("Lucken,I want to tell you sth !");
        System.out.println("Lucken,I want to tell you sth !");
        JL();
        System.out.println("****************");
        System.out.println("****************");
        LJ();
      }
      public static void JL(){
        int num=1;
        if(num==1){
          System.out.println("嘿 jae 你知道吗 发生了故事");
        }
        else
          System.out.println("message.....");
      }
      public static void LJ(){
      int num=3;
      if(num==1){
        System.out.println("我不知道你在想什么!");
      }
      else if(num==2){
        System.out.println("message.....");
      }
      else
        System.out.println("我也思念你了");
      }

    }

  • 相关阅读:
    js中const,var,let区别与用法
    poi excel 导出
    spring 实体类 date类型字段处理
    mysql 1449 : The user specified as a definer ('root'@'%') does not exist
    pjax学习
    上传文件 connection reset
    mysql连接问题
    Scala Actor Model
    Scala 隐式转换
    Scala Trait+Match+Case class+偏函数
  • 原文地址:https://www.cnblogs.com/worldof/p/10669624.html
Copyright © 2020-2023  润新知