java基础语法部分有哪些

Python021

java基础语法部分有哪些,第1张

Java的基础语法包括:

1. 开发环境搭建

2. 常量

3. 变量

4. 数据类型

5. 运算符

6. 选择结构-if-switch

7. 循环结构-while-【do-while】-for以及各种循环控制与多层嵌套循环

8. 方法的设计与使用

9. 数组

10. 递归

11. 冒泡-选择等多种排序

12. 二分查找

13. 线性查找

常用的输入语句是:

输入字符串:new Scanner(System.in).next()

输入整数:new Scanner(System.in).nextInt()

输入小数:new Scanner(System.in).nextDouble();

常用的输出语句:

换行输出: System.out.println(变量或字符串)

换行输出: System.out.print(变量或字符串)

换行输出错误提示(默认是红字):System.err.println(变量或字符串)

不换行输出错误提示(默认是红字): System.err.print(变量或字符串))