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 错误例子
  • 相关阅读:
    基于bootstrap分页
    encache学习教程
    java异常和spring事务注解
    JSP自定义标签开发入门
    spring junit
    vs与数据库连接查询
    winfrom文本文档打开
    面向对象 封装
    面向对象 概念
    DW 游记代码
  • 原文地址:https://www.cnblogs.com/linuxroot/p/3558311.html
Copyright © 2011-2022 走看看