为了账号安全,请及时绑定邮箱和手机立即绑定
慕课网数字资源数据库体验端
Java入门第一季(IDEA工具)_学习笔记_慕课网
为了账号安全,请及时绑定邮箱和手机立即绑定

Java入门第一季(IDEA工具)

IMOOC老齐 全栈工程师
难度入门
时长 5小时 0分
  • if为条件判断语句
    while为条件循环,满足一次一直循环


    查看全部
    0 采集 收起 来源:编程练习

    2019-04-25

  • 需要留心的几个小细节:

    1、 for 关键字后面括号中的三个表达式必须用 “;” 隔开,三个表达式都可以省略,但 “;” 不能省略。

        a. 省略“循环变量初始化”,可以在 for 语句之前由赋值语句进行变量初始化操作

    int i=0;

    for(;i<10;i++) {

    查看全部
  • (备忘)

    foreach

    for(String hobby : hobbys)

    {    System.out.println(hobby);

    }

    查看全部
    0 采集 收起

    2019-04-25

  • (备忘)

    import java.util.Arrays;

    Arrays.sort(数组名)   排序

    Arrays.toString(数组名)  转换为字符串

    查看全部
    0 采集 收起

    2019-04-25

  • (备忘)

    数组名.length  用于获取数组的长度

    查看全部
  • (备忘)

    int[] scores=new int[]{78,91,84,68};

    查看全部
  • int a=50;

    while(a <= 850) [

    System.out.println("总共” +850*a+"粒");

    a++;

    }

    查看全部
  • int max=98;

    switch(max){

    case 57:

    System.out.println("比小明分数高");

    case 79:

    System.out.println("比阿东分数高");

    case 88:

    System.out.println("比小红分数高");

    break;

    default:

    System.out.println("第一名是" +max+"分的小刘");

    }

    查看全部
  • 1、我们可以通过 javadoc 命令从文档注释中提取内容,生成程序的 API 帮助文档。

    2、使用文档注释时还可以使用 javadoc 标记,生成更详细的文档信息:

           @author 标明开发该类模块的作者

           @version 标明该类模块的版本

           @see 参考转向,也就是相关主题

           @param 对方法中某参数的说明

           @return 对方法返回值的说明

           @exception 对方法可能抛出的异常进行说明


    查看全部
  • int max=108;

    System.out.print("他的分数在:" );

    if(max > 60){

    if(max >= 60; max<80){

    System.out.println("60~80");

    }eles{

    System.out.println("80~100");

    }

    }else]

    System.out.println("100~120");

    }




    查看全部
  • public
    查看全部
    0 采集 收起 来源:变量是什么

    2019-04-24

  • 在编写程序时,经常需要添加一些注释,用以描述某段代码的作用。

    一般来说,对于一份规范的程序源代码而言,注释应该占到源代码的 1/3 以上。因此,注释是程序源代码的重要组成部分,一定要加以重视哦!

    Java 中注释有三种类型:单行注释、多行注释、文档注释

    运行结果: Hello Imooc!

    看:被注释的代码块在程序运行时是不会被执行的~~

    我们可以通过 javadoc 命令从文档注释中提取内容,生成程序的 API 帮助文档。

    打开首页,查看下生成的 API 文档

    PS:使用文档注释时还可以使用 javadoc 标记,生成更详细的文档信息:

           @author 标明开发该类模块的作者

           @version 标明该类模块的版本

           @see 参考转向,也就是相关主题

           @param 对方法中某参数的说明

           @return 对方法返回值的说明

           @exception 对方法可能抛出的异常进行说明


    查看全部
  • int类型可以转化成double
    但不能反过来转化
    interesting不能自动专成char


    查看全部
  • 怎么知道double 和float超过存储字节符

    查看全部
  • oracle官网的Java Language Specification文档是这样描述Identifiers的:
    An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter.
    Identifier:
    IdentifierChars but not a Keyword or BooleanLiteral or NullLiteral
    IdentifierChars:
    JavaLetter {JavaLetterOrDigit}
    JavaLetter:
    any Unicode character that is a "Java letter"
    JavaLetterOrDigit:
    any Unicode character that is a "Java letter-or-digit"

    A "Java letter" is a character for which the method Character.isJavaIdentifierStart(int) returns true.

    A "Java letter-or-digit" is a character for which the method Character.isJavaIdentifierPart(int) returns true.

    The "Java letters" include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). The $ sign should be used only in mechanically generated source code or, rarely, to access pre-existing names on legacy systems.

    The "Java digits" include the ASCII digits 0-9 (\u0030-\u0039).

    Letters and digits may be drawn from the entire Unicode character set, which supports most writing scripts in use in the world today, including the large sets for Chinese, Japanese, and Korean. This allows programmers to use identifiers in their programs that are written in their native languages.

    An identifier cannot have the same spelling (Unicode character sequence) as a keyword (§3.9), boolean literal (§3.10.3), or the null literal (§3.10.7), or a compile-time error occurs.

    Two identifiers are the same only if they are identical, that is, have the same Unicode character for each letter or digit. Identifiers that have the same external appearance may yet be different.

    For example, the identifiers consisting of the single letters LATIN CAPITAL LETTER A (A, \u0041), LATIN SMALL LETTER A (a, \u0061), GREEK CAPITAL LETTER ALPHA (A, \u0391), CYRILLIC SMALL LETTER A (a, \u0430) and MATHEMATICAL BOLD ITALIC SMALL A (a, \ud835\udc82) are all different.

    Unicode composite characters are different from their canonical equivalent decomposed characters. For example, a LATIN CAPITAL LETTER A ACUTE (Á, \u00c1) is different from a LATIN CAPITAL LETTER A (A, \u0041) immediately followed by a NON-SPACING ACUTE (´, \u0301) in identifiers. See The Unicode Standard, Section 3.11 "Normalization Forms".

    Examples of identifiers are:
        String
        i3
        αρετη
        MAX_VALUE
        isLetterOrDigit

        大概意思就是说,标识符是由java字母和java数字组成的,而字母和数字可以从整个Unicode字符集中抽取:即ascii编码中的大小写字母 A-Z (\u0041-\u005a) and a-z (\u0061-\u007a)、数字digits 0-9 (\u0030-\u0039)、下划线underscore (_, or \u005f)、$符dollar sign ($, or \u0024)以及除ascii字符集的Unicode字符集组成(Unicode字符集包含ascii);其中标识符的首个字符编码不为数字,即编码不能在(\u0030-\u0039)范围中;

        所以说中文也可以做标识符;为了规范代码,我们一般使用ascii字符集的字符来组成标识符,而不用中文等Unicode字符集的字符

    文档地址(java8):https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.8

    查看全部
    1 采集 收起 来源:认识Java标识符

    2019-04-24

举报

0/150
提交
取消
课程须知
学习中需要用到这些工具: —JDK-Java开发环境 —IDEA编程开发工具 课程适合零基础的同学,只要你对Java有兴趣,都可以0成本完成入门!、
老师告诉你能学到什么?
1、会配置Java开发环境,并使用工具进行程序开发 2、掌握Java中基本语法的使用并入门
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!