首页 > 代码库 > 我的成果

我的成果

                                                                                 第一章

           1 :符号的意义;

                     //:在代码中的意思是单行注释;

                     /*~*/:在代码中意思是多行注释;

                     (;):括号里的分号在代码中的意思是一行代码结束的符号;

               2 :java的结构;

public class Demo0 {            //外成结构

 public static void main(String[] args) {     //内城结构
    System.out.println("你好!");           //输出代码

 }

}

              (1) 输入发:

                    Scanner input = new   Scanner(System.in);记住的倒包;

                      int name=input.nextInt();

 

                                                                                第二章

            1 :数据类型;

                            int : 它储存是一个整数类型,就是没有小数点的数字;

                            double : 双精度,它储存是一个小数类型,就是有小数点的数字;

                            string :字符串,它储存是由多个字,多个字母组成,例如,姓名,型号等;

                             char : 字符,他储存单个字或字母,俗称"光棍" 但是要用括号括起来;

             2 : 数据类型使用格式;

               (1)声明赋值:                                                                    (2)  输入用法:

                      int  cose=100;                                                                int cose=input.nextInt();  

                      double  cose=99.99;                                                        double cose=input.nextDouble();

                      string name=小帅帅;                                                            String name=input.next();

                       char name=‘男‘    ‘女‘;                                                           char name=input.nextCharAt(0);

                  

                    (3)使用:   

public class Demo0 {            //外成结构

 public static void main(String[] args) {     //内城结构

            int cose=100;
    System.out.println(cose);           //输出代码

 }

}

                        3 :运算符;

                               + : 加号;

                                - : 减号;

                                * : 乘法;

                                / : 除法;

                               %: 取余;

                              关系运算符;

                                      < : 小于;

                                       > : 大于;

                                       <= : 小于等于;

                                       >= : 大于等于;

                                        == : 等于;

                                       != : 不等于;

                       示例:

                             

public class Demo0 {            //外成结构

 public static void main(String[] args) {     //内城结构]

              Scanner input = new   Scanner(System.in);记住的倒包;

                                   int num=0;

                             System.out.println("输入数字")

                           int cose=input.nextInt();

                                 int num=cose;

                System.out.println(num);           //输出代码

 }

}

                    

我的成果