当前位置: 首页 > news >正文

网站app开发哪家好企业如何做好网站的seo优化

网站app开发哪家好,企业如何做好网站的seo优化,网站建设的运营计划,如何开网店无货源不需要投资对象的起源 Object 文章来源#xff1a;《Head First Java》修炼感悟。 上一篇文章中#xff0c;老白学习了抽象类和抽象方法#xff0c;不禁感慨#xff0c;原来 Java 还可以这样玩。 同时又有了新的疑问#xff0c;这些父类从何而来的#xff1f; 本篇文章老白来聊一聊…对象的起源 Object 文章来源《Head First Java》修炼感悟。 上一篇文章中老白学习了抽象类和抽象方法不禁感慨原来 Java 还可以这样玩。 同时又有了新的疑问这些父类从何而来的 本篇文章老白来聊一聊「对象的起源」再次捂脸好炫酷的用词。 与生俱来的「超能力」 Java 中的所有类都是由 Object 继承而来即便是你自己创建的类也是如此。 也就是说Object 是所有类的父类。 比如我们设计 Dog 类时看起来没有继承任何类其实还是隐式地继承自 Object #mermaid-svg-YutuhZV3GxYapazn {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-YutuhZV3GxYapazn .error-icon{fill:#552222;}#mermaid-svg-YutuhZV3GxYapazn .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-YutuhZV3GxYapazn .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-YutuhZV3GxYapazn .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-YutuhZV3GxYapazn .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-YutuhZV3GxYapazn .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-YutuhZV3GxYapazn .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-YutuhZV3GxYapazn .marker{fill:#333333;stroke:#333333;}#mermaid-svg-YutuhZV3GxYapazn .marker.cross{stroke:#333333;}#mermaid-svg-YutuhZV3GxYapazn svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-YutuhZV3GxYapazn g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-YutuhZV3GxYapazn g.classGroup text .title{font-weight:bolder;}#mermaid-svg-YutuhZV3GxYapazn .nodeLabel,#mermaid-svg-YutuhZV3GxYapazn .edgeLabel{color:#131300;}#mermaid-svg-YutuhZV3GxYapazn .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-YutuhZV3GxYapazn .label text{fill:#131300;}#mermaid-svg-YutuhZV3GxYapazn .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-YutuhZV3GxYapazn .classTitle{font-weight:bolder;}#mermaid-svg-YutuhZV3GxYapazn .node rect,#mermaid-svg-YutuhZV3GxYapazn .node circle,#mermaid-svg-YutuhZV3GxYapazn .node ellipse,#mermaid-svg-YutuhZV3GxYapazn .node polygon,#mermaid-svg-YutuhZV3GxYapazn .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-YutuhZV3GxYapazn .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-YutuhZV3GxYapazn g.clickable{cursor:pointer;}#mermaid-svg-YutuhZV3GxYapazn g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-YutuhZV3GxYapazn g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-YutuhZV3GxYapazn .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-YutuhZV3GxYapazn .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-YutuhZV3GxYapazn .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-YutuhZV3GxYapazn .dashed-line{stroke-dasharray:3;}#mermaid-svg-YutuhZV3GxYapazn #compositionStart,#mermaid-svg-YutuhZV3GxYapazn .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-YutuhZV3GxYapazn #compositionEnd,#mermaid-svg-YutuhZV3GxYapazn .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-YutuhZV3GxYapazn #dependencyStart,#mermaid-svg-YutuhZV3GxYapazn .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-YutuhZV3GxYapazn #dependencyStart,#mermaid-svg-YutuhZV3GxYapazn .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-YutuhZV3GxYapazn #extensionStart,#mermaid-svg-YutuhZV3GxYapazn .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-YutuhZV3GxYapazn #extensionEnd,#mermaid-svg-YutuhZV3GxYapazn .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-YutuhZV3GxYapazn #aggregationStart,#mermaid-svg-YutuhZV3GxYapazn .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-YutuhZV3GxYapazn #aggregationEnd,#mermaid-svg-YutuhZV3GxYapazn .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-YutuhZV3GxYapazn .edgeTerminals{font-size:11px;}#mermaid-svg-YutuhZV3GxYapazn :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 隐式继承 Object Dog 虽然后来 Dog 继承了 Canine、Animal但最终还是会继承自 Object #mermaid-svg-w1QcqrSxvYGWs47C {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-w1QcqrSxvYGWs47C .error-icon{fill:#552222;}#mermaid-svg-w1QcqrSxvYGWs47C .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-w1QcqrSxvYGWs47C .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-w1QcqrSxvYGWs47C .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-w1QcqrSxvYGWs47C .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-w1QcqrSxvYGWs47C .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-w1QcqrSxvYGWs47C .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-w1QcqrSxvYGWs47C .marker{fill:#333333;stroke:#333333;}#mermaid-svg-w1QcqrSxvYGWs47C .marker.cross{stroke:#333333;}#mermaid-svg-w1QcqrSxvYGWs47C svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-w1QcqrSxvYGWs47C g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-w1QcqrSxvYGWs47C g.classGroup text .title{font-weight:bolder;}#mermaid-svg-w1QcqrSxvYGWs47C .nodeLabel,#mermaid-svg-w1QcqrSxvYGWs47C .edgeLabel{color:#131300;}#mermaid-svg-w1QcqrSxvYGWs47C .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-w1QcqrSxvYGWs47C .label text{fill:#131300;}#mermaid-svg-w1QcqrSxvYGWs47C .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-w1QcqrSxvYGWs47C .classTitle{font-weight:bolder;}#mermaid-svg-w1QcqrSxvYGWs47C .node rect,#mermaid-svg-w1QcqrSxvYGWs47C .node circle,#mermaid-svg-w1QcqrSxvYGWs47C .node ellipse,#mermaid-svg-w1QcqrSxvYGWs47C .node polygon,#mermaid-svg-w1QcqrSxvYGWs47C .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-w1QcqrSxvYGWs47C .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-w1QcqrSxvYGWs47C g.clickable{cursor:pointer;}#mermaid-svg-w1QcqrSxvYGWs47C g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-w1QcqrSxvYGWs47C g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-w1QcqrSxvYGWs47C .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-w1QcqrSxvYGWs47C .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-w1QcqrSxvYGWs47C .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-w1QcqrSxvYGWs47C .dashed-line{stroke-dasharray:3;}#mermaid-svg-w1QcqrSxvYGWs47C #compositionStart,#mermaid-svg-w1QcqrSxvYGWs47C .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-w1QcqrSxvYGWs47C #compositionEnd,#mermaid-svg-w1QcqrSxvYGWs47C .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-w1QcqrSxvYGWs47C #dependencyStart,#mermaid-svg-w1QcqrSxvYGWs47C .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-w1QcqrSxvYGWs47C #dependencyStart,#mermaid-svg-w1QcqrSxvYGWs47C .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-w1QcqrSxvYGWs47C #extensionStart,#mermaid-svg-w1QcqrSxvYGWs47C .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-w1QcqrSxvYGWs47C #extensionEnd,#mermaid-svg-w1QcqrSxvYGWs47C .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-w1QcqrSxvYGWs47C #aggregationStart,#mermaid-svg-w1QcqrSxvYGWs47C .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-w1QcqrSxvYGWs47C #aggregationEnd,#mermaid-svg-w1QcqrSxvYGWs47C .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-w1QcqrSxvYGWs47C .edgeTerminals{font-size:11px;}#mermaid-svg-w1QcqrSxvYGWs47C :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 隐式继承 Object Animal Canine Dog 既然 Object 是所有类最原始的父类那所有类肯定会继承到 Object 的某些行为而且这些行为应该是最通用的、能适用于所有对象的。 很好奇 Object 到底都提供了哪些行为呢 设想一下假如自己设计 Object 类的话会抽取哪些共性的元素呢 能与其它对象进行对比的方法能生成自己唯一标识的方法能描述自己的方法等等… 好消息是Object 真的实现了类似的方法而且还远不止这些 #mermaid-svg-ccEhCOx1AMTqA4sw {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-ccEhCOx1AMTqA4sw .error-icon{fill:#552222;}#mermaid-svg-ccEhCOx1AMTqA4sw .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-ccEhCOx1AMTqA4sw .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-ccEhCOx1AMTqA4sw .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-ccEhCOx1AMTqA4sw .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-ccEhCOx1AMTqA4sw .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-ccEhCOx1AMTqA4sw .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-ccEhCOx1AMTqA4sw .marker{fill:#333333;stroke:#333333;}#mermaid-svg-ccEhCOx1AMTqA4sw .marker.cross{stroke:#333333;}#mermaid-svg-ccEhCOx1AMTqA4sw svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-ccEhCOx1AMTqA4sw g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-ccEhCOx1AMTqA4sw g.classGroup text .title{font-weight:bolder;}#mermaid-svg-ccEhCOx1AMTqA4sw .nodeLabel,#mermaid-svg-ccEhCOx1AMTqA4sw .edgeLabel{color:#131300;}#mermaid-svg-ccEhCOx1AMTqA4sw .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-ccEhCOx1AMTqA4sw .label text{fill:#131300;}#mermaid-svg-ccEhCOx1AMTqA4sw .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-ccEhCOx1AMTqA4sw .classTitle{font-weight:bolder;}#mermaid-svg-ccEhCOx1AMTqA4sw .node rect,#mermaid-svg-ccEhCOx1AMTqA4sw .node circle,#mermaid-svg-ccEhCOx1AMTqA4sw .node ellipse,#mermaid-svg-ccEhCOx1AMTqA4sw .node polygon,#mermaid-svg-ccEhCOx1AMTqA4sw .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-ccEhCOx1AMTqA4sw .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-ccEhCOx1AMTqA4sw g.clickable{cursor:pointer;}#mermaid-svg-ccEhCOx1AMTqA4sw g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-ccEhCOx1AMTqA4sw g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-ccEhCOx1AMTqA4sw .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-ccEhCOx1AMTqA4sw .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-ccEhCOx1AMTqA4sw .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-ccEhCOx1AMTqA4sw .dashed-line{stroke-dasharray:3;}#mermaid-svg-ccEhCOx1AMTqA4sw #compositionStart,#mermaid-svg-ccEhCOx1AMTqA4sw .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-ccEhCOx1AMTqA4sw #compositionEnd,#mermaid-svg-ccEhCOx1AMTqA4sw .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-ccEhCOx1AMTqA4sw #dependencyStart,#mermaid-svg-ccEhCOx1AMTqA4sw .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-ccEhCOx1AMTqA4sw #dependencyStart,#mermaid-svg-ccEhCOx1AMTqA4sw .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-ccEhCOx1AMTqA4sw #extensionStart,#mermaid-svg-ccEhCOx1AMTqA4sw .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-ccEhCOx1AMTqA4sw #extensionEnd,#mermaid-svg-ccEhCOx1AMTqA4sw .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-ccEhCOx1AMTqA4sw #aggregationStart,#mermaid-svg-ccEhCOx1AMTqA4sw .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-ccEhCOx1AMTqA4sw #aggregationEnd,#mermaid-svg-ccEhCOx1AMTqA4sw .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-ccEhCOx1AMTqA4sw .edgeTerminals{font-size:11px;}#mermaid-svg-ccEhCOx1AMTqA4sw :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 隐式继承 Object Class getClass() int hashCode() String toString() equals() YourClass 以上仅是列出了 Object 的部分方法并且这些方法都已经实现了意味着你所创建的每一个类都可以直接使用它们比如 public class ObjectTest {public static void main(String[] args) {Dog dogA new Dog();Dog dogB new Dog(); // testSystem.out.println(dogA.equals(dogB));System.out.println(dogA.hashCode());System.out.println(dogA.getClass());System.out.println(dogA.toString());} } class Dog {}编译执行结果 简直不可思议Dog 刚被创建出来就拥有了「超能力」关键是它什么也没做。 Object 并不适合多态引用 Object 作为最顶端的父类那是不是可以说允许用任何子类引用它 试想一下如果把 ArrayList 的元素类型声明为 Object那岂不是可以保存任何类型了想法一点也没错请看 ArrayListObject dogList new ArrayListObject(); Dog dogA new Dog(); dogList.add(dogA);以上代码没有问题确实可以将 Dog 对象保存到列表中。 但是如果从列表中取出对象时会出现问题 Dog dogB dogList.get(0);可以看到无论你放入的是什么类型取出时总是被当作 Object 类型。 编译器无法将取出的对象识别为 Object 以外的其它类型。 方法返回 Object 类型时也会出现同样问题 Dog dogA new Dog(); Dog dog getObject(dogA); public Object getObject(Object o) {return o; }虽然确实传入了 Dog 对象但 getObject() 返回的只能是 Object 类型。 如果还是不死心强制执行 Dog 应有的方法比如 getObject(dogA).bark();编译器还是会拒绝因为编译器不认为 Object 有 bark() 这个方法它只认得 Object 应有的那些方法。 《 上一篇 抽象类和抽象方法下一篇 抽象的极致是「接口」》
http://www.dnsts.com.cn/news/171617.html

相关文章:

  • 金华婺城区建设局网站wordpress 抄炫插件
  • 微企免费做网站如何制作网址教程
  • 哪个网站可以接工程做网络系统建设与运维职业技能等级证书
  • 网站建设优化规划书宝塔wordpress无法打开
  • 男女做暖网站是什么意思做关于车的网站好
  • 校园网站建设的缺陷辽宁省建设工程信息网出问题了
  • pc端购物网站建站网店托管协议
  • 做网站用软件湖南长沙seo
  • 做网站能接到模具单吗58同城广告推广电话
  • 大连学网站制作wordpress最近文章
  • ie 10 常用网站广告创意设计图片赏析
  • 各种网站开发语言的优缺点html5开发网站
  • 网站程序开发费用男的做直播网站
  • 网站建设编辑器怎么创建网站快捷方式到桌面
  • 中企动力做网站贵吗电力建设监理招聘网站
  • 网站开发课程设计建议中装建设董事长
  • 利于seo的网站设计做网站要
  • 共享互助医疗网站建设做微信推送用什么网站
  • 大兴区网站建设公司大连 模板网站
  • wordpress首页显示链接地址宁波网站排名优化seo
  • 网站建设哈尔滨网站建设1制作公众号
  • 用wordpress当wiki广东网站优化公司
  • 湖南高端网站制网页建站要多久
  • 服务器卸载wordpress飓风seo刷排名软件
  • 用于建设教学网站的建站工具有哪些特点汉字域名的网站
  • 2345网址导航中国最好的网址站wordpress安装脚本
  • 西安网站建设流程android应用开发期末考试题
  • 优秀网站案列找装修公司上什么网站
  • 中山 灯饰 骏域网站建设专家徐州建站模板公司
  • 北京网站建设联系电话wordpress 添加js