- String中的首字母需要大写
- 输出是sout tab键
- Long类型赋值的时候要在数字后面加上一个小写的L
- 字符串使用+可以让多个字符串链接在一起例如public static void main(String[] args){String name = "章问"; System.out.println("姓名:"+name+" 年龄:"+18);}
- boolean isAllow = true;
- Math.random()方法用于返回一个随机数(浮点数),随机数范围为0.0=<Math.radom<1.0
- int nValue = (int) value;类型转换方法
- 固定的方法格式,main方法用于启动程序public static void main(String[] args)
- public static void 方法名称(方法参数){ } 例如:public static void myDocument(){ }第一个单词小写,后面单词的首字母大写。’
- 方法调用:在main程序中打出方法的名称例如:myDocunent();
- 2中是形参,而调用random(数字)中的数字是实参
- Return中断后面所有的代码
- 递归就是在自己的函数中用自己的函数 15.// 验证码方法public static void code(int len) // 随机数方法public static double random() 15.### boolen(布尔) boolen类型是返回true/flase
- // 声明一个 int 数组的变量,数组大小为6 int[] numbers = new int[6]; int size = numbers.length测长度
- int默认值为0,String默认值为null 1.### charAt() String message = "Hello Java"; // 取出第一个字 char str = message.charAt(0); 2.### trim() String str = " 优课达 ";// 处理一下去空格 String newStr = str.trim();(只能去除两边的空格,中间的去除不了)
星河
authored