欢迎来到人人文库网! | 帮助中心 人人文档renrendoc.com美如初恋!
人人文库网
全部分类
  • 图纸下载>
  • 教育资料>
  • 专业文献>
  • 应用文书>
  • 行业资料>
  • 生活休闲>
  • 办公材料>
  • 毕业设计>
  • ImageVerifierCode 换一换
    首页 人人文库网 > 资源分类 > DOC文档下载  

    java听课记录(java听课记录).doc

    • 资源ID:59901627       资源大小:51.63KB        全文页数:6页
    • 资源格式: DOC        下载积分:15积分
    扫码快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 支付宝登录   QQ登录   微博登录  
    二维码
    微信扫一扫登录

    手机扫码下载

    请使用微信 或支付宝 扫码支付

    • 扫码支付后即可登录下载文档,同时代表您同意《人人文库网用户协议》

    • 扫码过程中请勿刷新、关闭本页面,否则会导致文档资源下载失败

    • 支付成功后,可再次使用当前微信或支付宝扫码免费下载本资源,无需再次付费

    账号:
    密码:
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源(1积分=1元)下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    java听课记录(java听课记录).doc

    java听课记录(java听课记录) java听课记录(java听课记录)object类中定义有public stringtostring()方法,返回值是string类型,描述当前对象的有关信息.在进行string与其他类型数据的连接操作时(如system.out.println("info"+person),将自动调用该对象类tostring()方法注:一个字符串和另外一种类型连接时,另外一种类型直接转成string类型,适用于与基本类型的连接.可以根据需要在用户自定义类型中重写tostring()方法object类中定义有:public booleanequals(object obj)方法提供定义对象是否"等于"的逻辑object的equals(加s是第三人称的意思)方法定义为:x.equals(y),相当于x和y是同一个对象的引用时返回true否则返回false j2sdk提供了一些类,如string,date等,重写了object的equals方法,调用这些类的equals方法,x.equals(y),当x和y所引用的对象是同一类对象且属性内容相等时(不一定是相同的对象),返回true否则返回false可以根据需要在用户定义类型中重写equals方法.对象转型一个父类(也称基类)的引用类型变量可以"指向"其子类的对象.一个父类的引用不可以访问其子类对象新增的成员(属性和方法)可以使用引用变量instanceof类名来判断该引用型变量所"指向"的对象是否属于该嘞活该类的子类子类的对象可以当作父类的对象来使用称之为向上转型(u盘casting),反之称之为向下转型(downcasting)注释:父类引用指向子类时,子类自身的属性和方法不可访问如果一定要访问子类属性要进行强制转换思考一下对象转型对可扩展性带来的好处面向对象的核心内容动态绑定和多态动态绑定是指在执行期间(而非编译期)判断所引用对象的实际类型,分局其实际的类型调用其相应的方法将可扩展性达到最好,调用的方法是新new出来的重中之重,要灵活绑定多态存在的必要条件要有继承,要有重写,父类引用指向子类对象用abstract关键字来定义的类叫做抽象类,用bstract定义的方法叫做抽象方法含有抽象方法的类必须被声明为朝向类,抽象类必须被继承,抽象方法必须被重写抽象类不能被实例化抽象方法只需声明不需实现(因为会被子类继承然后子类重写方法)final关键字final的变量的值不能被改变final的成员变量final的局部变量(形参)final的方法不能被重写final的类不能被继承接口多个无关的类可以实现同一个接口一个类可以实现多个无关的接口与继承关系类似,接口与实现类之间存在多态性定义java类的语法格式:-modifier>classextends<>implements interface,interface*)接口的定义接口(interface)是抽象方法和常量值得定义的集合本质上讲,接口是一种特殊的抽象类,这种抽象类中只包含常量和方法的定义,没有变量和方法的实现接口的特点解救可以多重实现接口中声明的属性默认为public staticfinal的,只能是public staticfinal解救中只能定义抽象方法,而且这些方法默认为public的Interfaces caninherit otherinterfaces andadd propertiesand methodsConstruction method:1.The nameof the construction methodmust bethe same as the class name,and thecase must be exactly the same2,the construction method can be modifiedusing fourpermissions modifiers3.The construction method does not havea returnvalue type4,the construction method ofa classcan havemore thanone,mainly byparameter difference5.The methodbody of the construction method canwrite anystatement thatconforms tothe Javasyntax,but mostof the construction methodsare usedto initializedata membersIn Java,the construction method,there is a problemwe need to payspecial attentionto,is thedefault constructor,if atype declarationdoes notshow theconstruction method,then therewill bea defaultmethod,this methodhas noparameters,the methodbody alsois empty,Such aspublic,Customer()However,as longas the class showsthe declaredconstruction method,theconstructionmethod of the lunchdoes notdefault;if youneedtouse it,you mustalso declarethe declarationThe constructionmethod isa specialmethod,different from the general method:1.The nameof theconstructionmethodmustbeexactlythe same astheclassname thatdefines it.There is no return type,not eventhe void2.The invocationof theconstructionmethodis doneusing thenew operationwhen creatingan object,and theconstructionmethodis alsothe object of initialization3.can notbe modifiedby static,final,synchronized,abstract andnative.The constructionmethod cannotinherit fromthe quiltclass Construction methods canbe overloaded.Construction methodwithout parameterscalled thedefault constructor,and thegeneralmethodof constructingmethod cancarry outany activity,but oftenit isdesigned asa varietyof activitiessuch asinitialization,initialize theobject attribute.In Java,must firstset theinitial valueof anyvariable beforeit isused,Java providesa membervariable aninitial valueof tastebud dedicatedto function:constructionmethodconstructionmethod(constructor)isakind ofspecial membermethod,her specialreflected in the followingaspects:1.The constructionmethod nameis thesameastheclassname2,theconstructionmethod doesnot returnany value,and thereisnoreturntype3,each classcan haveanother livemultiple constructionmethods4.Construction methodsare automaticallyexecuted whenobjects arecreated andcan notbe explicitlycalled directlyCommon classString classThe java.lang.String classrepresents immutablecharacter sequences"Xxxxx"is anobjectofthis classThe monmethods toconstruct String:String(String original):creates acopy of the String object forOriginal String(charvalut):creates a Stringobjectwith acharacter numberString(charvalue.int offset.int count):aStringobject iscreated with the countsequence ofcharacters startingwiththeoffset itemwith anarray ofcharacters Stringclass monlyused methods:Public charcharAt(int index)Returns thefirst indexcharacter inthe string Public,int,length()Returns thelength of the string Public,int,indexof(String,STR,int,fromIndex)Returns thefirst positionof theStr inthe string that appearsfromthebeginning ofthe fromIndexPublic,Boolean,equals,IgnoreCase(String,another)Returns thesame stringas another(ignore case)Public,String,replace(char,oldChar,char,newChar)Replace OldCharcharacters withnewChar charactersin a string PublicBoolean startsWith(String prefix(prefix)Determines whetherthe stringstarts withan prefixstring PublicbooleanendsWith(String suffix(suffix)Determines whetherthe stringhas terminatedat thesuffix string Public,String,toUpperCase()Returns astring formingthe uppercaseofthe stringPublic,String,toLowerCase()Returns astring thatis lowercaseinthestringPublicString substring(int beginIndex)Returns thesubstring frombeginIndex tothe endofthestringPublic,String,substring(int,beginIndex,int,endIndex)Returns thesubstring ofthestringstarting frombeginIndex tothe endoftheendIndex Public,String,trim()Returns thestringthatremoves thebeginning andend spacesofthestring Staticoverloading methodPublic,static,String,valueOf(.)Basic typesof datacanbeconverted intostrings:Such as:Public,static,String,valueOf(double,d)Public,static,String,valueOf(int,I)Method publicStringsplit(String regex)can tellastring,separated bythe specifieddelimiter,to returnthe separatedstring array.StringBuffer classJava.lang.StringBuffer standsfor mutablecharacter sequencesStringBuffer issimilar toString,but StringBuffercan changeits stringsCommon constructionmethods forStringBuffer classes:StringBuffer()Creates anempty StringBuffer object thatdoesnotcontain acharacter sequenceStringBuffer(String,STR)Creates aStringBufferobjectthat containsthesamesequence ofcharacters asthe Stringobject strBasic datatype wrapperclass Wrapperclasses suchas Integer,Double,etc.these classesencapsulate acorresponding datatype valueand providea seriesof operationsfor itTake thejava.lang.Integer classas anexample:Constructionmethod:Integer(int,value)Integer(String,s)。 内容仅供参考

    注意事项

    本文(java听课记录(java听课记录).doc)为本站会员(小***)主动上传,人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知人人文库网(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    网站客服QQ:2881952447     

    copyright@ 2020-2024  renrendoc.com 人人文库版权所有   联系电话:400-852-1180

    备案号:蜀ICP备2022000484号-2       经营许可证: 川B2-20220663       公网安备川公网安备: 51019002004831号

    本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知人人文库网,我们立即给予删除!