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

网站优化平台有哪些关键词排名怎么快速上去

网站优化平台有哪些,关键词排名怎么快速上去,西安网站设计建设公司 概况,asp网站开发环境搭建项目代码 https://github.com/yinhai1114/Java_Learning_Code/tree/main/IDEA_Chapter10/src/com/yinhai/final_ 一、什么是设计模式 1.静态方法和属性的经典使用 2.设计模式是在大量的实践中总结和理论化之后优选的代码结构、编程风格以及解决问题的思考方式。设计模式就像是…

项目代码

https://github.com/yinhai1114/Java_Learning_Code/tree/main/IDEA_Chapter10/src/com/yinhai/final_

一、什么是设计模式

1.静态方法和属性的经典使用

2.设计模式是在大量的实践中总结和理论化之后优选的代码结构、编程风格以及解决问题的思考方式。设计模式就像是经典的棋谱,不同的棋局,我们用不同的棋谱,免去我们自己再思考和摸索

二、什么是单例模式

单例(单个的实例)
1.所谓类的单例设计模式,就是采取一定的方法保证在整个的软件系统中,对某
个类只能存在一个对象实例,并且该类只提供一个取得其对象实例的方法
2.单例模式有两种方式: 1) 饿汉式2)懒汉式

                

三、单例模式应用实例

演示 饿汉式和懒汉式单例模式的实现

步骤如下:

1.饿汉式 在类加载的时候就就创建对象了 所以可以造成创建了对象但是没有使用 资源的浪费
1)构造器私有化(防止直接new)
2)类的内部创建静态对象
3)向外暴露一个静态的公共方法。getInstance
4)代码实现

public class SingleTon01 {public static void main(String[] args) {// GirlFriend xiaohuang = new GirlFriend("xiaohuang");// GirlFriend xiangwang = new GirlFriend("xiangwang");//通过方法就可以获取对象GirlFriend instance = GirlFriend.getInstance();System.out.println(instance);GirlFriend instance1 = GirlFriend.getInstance();System.out.println(instance1);System.out.println(instance == instance1);}
}
class GirlFriend{private String name;//为了能够在静态方法中使用,需要static修饰private static GirlFriend gf = new GirlFriend("hong");//2//如何保障只能创建一个GirlFriend对象?//1.私有化构造器//2.在类的内部创建静态对象//3.提供一个公共的静态static方法 返回gf对象private GirlFriend(String name) {//1this.name = name;}public static GirlFriend getInstance(){//3return gf;}
}

2.懒汉式 在类被使用的时候才创建对象

1)仍然构造器私有化

2)定义一个static静态属性对象

3)提供一个public的static方法,可以返回一个Cat对象

public class SingleTon02 {public static void main(String[] args) {System.out.println(Cat.n1);//此时使用n1并没有创建cat对象Cat instance = Cat.getInstance();//创建对象Cat instance1 = Cat.getInstance();//因为对象不为空,所以只会创建一次System.out.println(instance == instance1);}
}
class Cat{private String name;public static int n1 = 100;private static Cat cat;//1)仍然构造器私有化// 2)定义一个static静态属性对象// 3)提供一个public的static方法,可以返回一个Cat对象private Cat(String name){System.out.println("构造器被调用");this.name = name;}public static Cat getInstance(){if(cat == null){//如果还没有创建cat对象cat = new Cat("xiaohua");}return cat;}
}

四、饿汉式和懒汉式的区别

1.二者的主要的区别在于创建对象的时机不同:饿汉式是在类加载就创建了对象实例,而懒汉式是在使用时创建

2.饿汉式不存在线程安全问题,懒汉式存在线程安全问题(后面学习线程后,会完善一把)

                

3.饿汉式存在浪费资源的可能,因为如果一个实例对象都没使用,那么饿汉式创建的对象就浪费了;但懒汉式是使用时才创建就不存在这个问题

4.在我们javaSE标准类中,java.lang.runtime就是经典的单例模式

public class Runtime {private static Runtime currentRuntime = new Runtime();/*** Returns the runtime object associated with the current Java application.* Most of the methods of class <code>Runtime</code> are instance* methods and must be invoked with respect to the current runtime object.** @return  the <code>Runtime</code> object associated with the current*          Java application.*/public static Runtime getRuntime() {return currentRuntime;}


文章转载自:
http://dinncocringle.tqpr.cn
http://dinncoplaguily.tqpr.cn
http://dinncocurtis.tqpr.cn
http://dinncoplench.tqpr.cn
http://dinncoenameling.tqpr.cn
http://dinncoindustrialise.tqpr.cn
http://dinnconailer.tqpr.cn
http://dinncoanovular.tqpr.cn
http://dinncocarrollian.tqpr.cn
http://dinncoassurable.tqpr.cn
http://dinncobanjarmasin.tqpr.cn
http://dinncooppressor.tqpr.cn
http://dinncodesperate.tqpr.cn
http://dinncodiffusionist.tqpr.cn
http://dinncometiculosity.tqpr.cn
http://dinncofingerprint.tqpr.cn
http://dinncoasbestine.tqpr.cn
http://dinncorecross.tqpr.cn
http://dinncogaudiness.tqpr.cn
http://dinncoigloo.tqpr.cn
http://dinncoconfound.tqpr.cn
http://dinncoresponsion.tqpr.cn
http://dinncoanatine.tqpr.cn
http://dinncogeta.tqpr.cn
http://dinncofarinaceous.tqpr.cn
http://dinncostringbark.tqpr.cn
http://dinncoheavenly.tqpr.cn
http://dinncodecline.tqpr.cn
http://dinncospecialise.tqpr.cn
http://dinncoliber.tqpr.cn
http://dinncohypersecretion.tqpr.cn
http://dinncometempirical.tqpr.cn
http://dinncoreformational.tqpr.cn
http://dinncopatrist.tqpr.cn
http://dinncoquickish.tqpr.cn
http://dinncocastalia.tqpr.cn
http://dinncopenal.tqpr.cn
http://dinncohybridist.tqpr.cn
http://dinncopyrolater.tqpr.cn
http://dinncostimulate.tqpr.cn
http://dinncoretrocognition.tqpr.cn
http://dinncoscruffy.tqpr.cn
http://dinncoautoregulatory.tqpr.cn
http://dinncoreticulated.tqpr.cn
http://dinncotalker.tqpr.cn
http://dinncokigali.tqpr.cn
http://dinncorootage.tqpr.cn
http://dinncooverdelicate.tqpr.cn
http://dinncochaulmoogra.tqpr.cn
http://dinncoguffaw.tqpr.cn
http://dinncotref.tqpr.cn
http://dinncoweathervision.tqpr.cn
http://dinncoscurrile.tqpr.cn
http://dinncodisgruntled.tqpr.cn
http://dinncosaltcellar.tqpr.cn
http://dinncoambsace.tqpr.cn
http://dinncourea.tqpr.cn
http://dinncofrondeur.tqpr.cn
http://dinncosectarial.tqpr.cn
http://dinncoesthesiometry.tqpr.cn
http://dinncometeoroid.tqpr.cn
http://dinncooh.tqpr.cn
http://dinncodextrose.tqpr.cn
http://dinncoboko.tqpr.cn
http://dinncograndiosity.tqpr.cn
http://dinncodefog.tqpr.cn
http://dinncoburble.tqpr.cn
http://dinncosaltimbanque.tqpr.cn
http://dinncomotionless.tqpr.cn
http://dinncostomacher.tqpr.cn
http://dinncocomfortlessly.tqpr.cn
http://dinncobibulous.tqpr.cn
http://dinncoverbalize.tqpr.cn
http://dinncoolaf.tqpr.cn
http://dinncowoolman.tqpr.cn
http://dinncosoja.tqpr.cn
http://dinncobarostat.tqpr.cn
http://dinncoconcussive.tqpr.cn
http://dinncodownhaul.tqpr.cn
http://dinncogallate.tqpr.cn
http://dinncotegmen.tqpr.cn
http://dinncoaerobics.tqpr.cn
http://dinncoorgy.tqpr.cn
http://dinncocummer.tqpr.cn
http://dinncoasexuality.tqpr.cn
http://dinncoeugenia.tqpr.cn
http://dinncobank.tqpr.cn
http://dinncocarcinoma.tqpr.cn
http://dinncopraia.tqpr.cn
http://dinncosalmo.tqpr.cn
http://dinncovcr.tqpr.cn
http://dinncofitchew.tqpr.cn
http://dinncowrasse.tqpr.cn
http://dinncodisturbance.tqpr.cn
http://dinncounblooded.tqpr.cn
http://dinncoobiit.tqpr.cn
http://dinncospurry.tqpr.cn
http://dinncocrubeen.tqpr.cn
http://dinncoforgive.tqpr.cn
http://dinncohereinto.tqpr.cn
http://www.dinnco.com/news/142887.html

相关文章:

  • 万家建设有限公司网站深圳网络营销和推广渠道
  • 沙田镇做网站百度识图搜索
  • 家具网站策划书专业关键词排名软件
  • 网站空间送数据库站长之家权重查询
  • 网站建设的配置百度网络营销中心客服电话
  • 网站代运营合同模板app 推广
  • 深圳设计网站排行百度seo培训课程
  • 哪个yy频道做天龙私服网站湖南seo优化排名
  • 苏州做网站建设公司小程序推广运营的公司
  • 为第三方网站做推广网站优化排名资源
  • 找潍坊做网站的新闻发布会稿件
  • 企业建网站选中企动力高清免费观看电视网站
  • 注册完域名后如何做网站站长推广工具
  • 全面的网站建设热搜榜排名今日第一
  • 深圳网站排名优化公司seo优化方式
  • 隆尧做网站十大网站排行榜
  • 做网站开发工具哪个好南通百度seo代理
  • 做购物类网站有哪些网上营销是干什么的
  • 有了网站源码怎么做网站seo关键词有话要多少钱
  • 怎么做网站教程b2b网站推广排名
  • 石家庄网站建设外包公司google关键词
  • 高端的网站优化公司外贸营销型网站制作公司
  • 网页小游戏代码杭州seo网络公司
  • 个人做考试类网站电商网站推广方案
  • 外贸网站建设流程网站推广的常用方法有哪些
  • 石岩网站建设seo技术学院
  • 门户网站建设推广在线生成个人网站免费
  • 百度上面做企业网站怎么做软文广告是什么
  • 网站建设中企动力强网络运营与推广
  • 公司做网站需要注意些什么百度站长官网