本文是我自己在秋招复习时的读书笔记,整理的知识点,也是为了防止忘记,尊重劳动成果,转载注明出处哦!如果你也喜欢,那就点个小心心,文末赞赏一杯豆奶吧,嘻嘻。 让我们共同成长吧……
一、编程基础
1、数据类型
基本数据类型:整数类型(byte、short、int、long)、小数类型(float、double)、字符类型(char)、布尔类型(boolean)
引用数据类型(对象类型)
2、基本运算
算术运算(+ 、—、* 、/、%、++、——)、比较运算(> < >= <= ==)、逻辑运算(& | ! ^ && ||)
3、条件执行
if switch
4、循环
while 、 do……while 、 for 、 foreach 、 break 、 continue
5、函数
二、面向对象
1、类的基础
(1) 类:表示自定义数据类型。
(2) Java Math类中的方法:round(float a) sqrt(double a) ceil(double a) floor(double a) pow(double a,double b) abs(int a)
max(int a,int b) log(double a) random()
Arrays类中的方法:sort(int[] a) sort(double[] a) binarySearch(long[] a,long key) fill(int[] a,int val)
copyOf(int[] original,int newLength) equals(char[] a,char[] b)
(3) String、StringBuffer、StringBuilder
String,StringBuffer,StringBuilder的区别及其源码分析(一)
String,StringBuffer,StringBuilder的区别及其源码分析(二)
2、类的继承
(1)Object是所有类的父类,里面包含了:equals(Object o) getClass() hashCode() notify() notifyAll() toString() wait()
wait(long timeout) wait(long timeout,int nanos)
继承用extends 实现用implements
3、类的扩展
接口、抽象类、内部类
4、异常
| — Error(VirtualMachineError、OutOfMemoryError、StackOverflowError)
Throwable |
|—(IOException、SQLException)
|—Exception |
|—RuntimeException(IllegalStateException、NullPointerException、ClassCastException、IndexOutOfBoundException、IllegalArgumentException、NumberFormatException)
自定义异常类,继承Exception或者子类。
异常处理:try…catch try…catch…finally try—with—resources throws throw
5、常用基础类
(1)包装类
Boolean、Byte、Short、Integer、Long、Float、Double、Character
包装类与基本类型的转换:
例如:int i1=12345; Integer iObj=Integer.valueOf(i1); int i2=iObj.intValue();
Java 5之后引入了自动的装箱和拆箱。
每个包装类都实现了Comparable接口,6中基本数值类型的父类是Number抽象类
网友评论