zoukankan      html  css  js  c++  java
  • <java基础学习>RE 基础语法

    1 public class MyFirstJavaProgram{
    2   public static void main(String[] args ){
    3         System.out.println("Hello World");
    4     }  
    5 
    6 }

    大小写敏感(case sensitive)——Hello和hello在java中有着不同的意义

    所有类名的首字母需为大写(upper case)

    所有方法名首字母为小写(lower case)

    文件名一般同类名 MyFirstJavaProgram.java

    public static void main(String args[]) —— 程序的入口

    java标识符(java identifiers)

    • All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an underscore (_).

    • 标识符由A-Z 或 a-z,美元符,下划线为首 
    • After the first character identifiers can have any combination of characters.

    • 第一个标识符确定后,后面可以为任何字符
    • A key word cannot be used as an identifier.

    • 关键字不能作为标识符
    • Most importantly identifiers are case sensitive.

    • 大多数标识符是区分大小写
    • Examples of legal identifiers: age, $salary, _value, __1_value 正确例子

    • Examples of illegal identifiers: 123abc, -salary 错误例子
  • 相关阅读:
    JavaScript中Null和Undefined的区别
    javascript中的计算题
    数组去重
    javascript面向对象中继承实现的几种方式
    数列求值 题解
    首字母变大写 题解
    发工资咯:) 题解
    绝对值排序 题解
    数列有序 题解
    母牛的故事 题解
  • 原文地址:https://www.cnblogs.com/linuxroot/p/3558311.html
Copyright © 2011-2022 走看看