首页 > 代码库 > java程序设计基础篇 复习笔记 第五单元

java程序设计基础篇 复习笔记 第五单元

1.method header: modifier, return value type, method signature(method name, parameter)method body2.value-returning methodvoid methodmethod overloadingambiguous invocation: max(int,double) max(double,int)3.formal parameteractual parameterparameter listparameter order associationpass-by-value4.scope of variablelocal scope5.Math数学类	trigonometric method: sin, cos, tan, asin, acos, atan, toRadians, toDegrees	exponent method: exp, log, log10, pow, sqrt	service: ceil, floor, rint, round,		min,max,abs,random6.divide-and-conquer: stepwise refinementstubKeyword:actual parameterargumentambiguous invocationdivide and conquerformal parameter: meterinformation hidingmethodmethod abstractionmethod overloadingmethod signaturemodifierpass-by-valueparameterreturn typereturn valuescope of variablestepwise refinementstub: 待完善方法5.1增强模块化和可重用性modifier return_value_type method_name method_parameter_list类名.方法名或者实例化对象.方法名5.2void5.3可以5.4不一定5.5java编译错误可以,不加值会5.10formal parameter: 定义在方法头中的变量actual parameter: 调用时参数的值method signature: 方法名+参数5.110;2 ;2 4 ;2 4 8 ;2 4 8 16 ;2 4 8 16 32 ;2 4 8 16 32 64 ;Before the call, variable times is 3Welcome to Java!Welcome to Java!Welcome to Java!After the call,variable times is 3;1 2 1 2 1 4 2 1 i is 4;5.12.......5.13定义不同方法体不同方法签名相同方法名的函数;可以;不行5.14重载发生冲突5.15局部变量和形参发生冲突

  

java程序设计基础篇 复习笔记 第五单元