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

惠东做网站网络推广与网络营销的区别

惠东做网站,网络推广与网络营销的区别,北京网站推广排名公司,商丘做手机做网站个人简介 👀个人主页: 前端杂货铺 ⚡开源项目: rich-vue3 (基于 Vue3 TS Pinia Element Plus Spring全家桶 MySQL) 🙋‍♂️学习方向: 主攻前端方向,正逐渐往全干发展 &#x1…

个人简介

👀个人主页: 前端杂货铺
开源项目: rich-vue3 (基于 Vue3 + TS + Pinia + Element Plus + Spring全家桶 + MySQL)
🙋‍♂️学习方向: 主攻前端方向,正逐渐往全干发展
📃个人状态: 研发工程师,现效力于中国工业软件事业
🚀人生格言: 积跬步至千里,积小流成江海
🥇推荐学习:🍖开源 rich-vue3 🍍前端面试宝典 🍉Vue2 🍋Vue3 🍓Vue2/3项目实战 🥝Node.js实战 🍒Three.js

🌕个人推广:每篇文章最下方都有加入方式,旨在交流学习&资源分享,快加入进来吧

内容参考链接
Java基础(一)Hello World,8种数据类型,键盘录入
Java基础(二)数组,方法,方法重载
Java基础(三)类和对象、构造方法

文章目录

    • 前言
    • String 字符串
    • StringBuffer
    • StringBuilder
    • StringJoiner
    • 总结

前言

大家好,这里是前端杂货铺。

本篇文章,我们认识字符串。


String 字符串

通过 new 创建的都是存储在堆内存中,所以 s1 和 s2 的地址并不相同,故不相等。

通过 equals 方法,我们可以只比较值而不比较地址;通过 equalsIgnoreCase 方法,我们可以忽略字符串大小写比较值。

public static void main(String[] args) {String s1 = new String("Abc");String s2 = "Abc";// 基本数据类型,比较数据值// 引用数据类型,比较地址值System.out.println(s1 == s2); // false// 比较对象的内容是否相等System.out.println(s1.equals(s2)); // false// 比较对象的内容是否相等,忽略大小写System.out.println(s1.equalsIgnoreCase(s2)); // true
}

在这里插入图片描述


StringBuffer

在使用 StringBuffer 类时,每次都会对 StringBuffer 对象本身进行操作,而不是生成新的对象,所以如果需要对字符串进行修改推荐使用 StringBuffer。

StringBuilder 类在 Java 5 中被提出,它和 StringBuffer 之间的最大不同在于 StringBuilder 的方法不是线程安全的(不能同步访问)。

由于 StringBuilder 相较于 StringBuffer 有速度优势,所以多数情况下建议使用 StringBuilder 类。

但是在应用程序要求线程安全的情况下,则必须使用 StringBuffer 类。

方法描述
append(String s)将指定的字符串追加到此字符序列
insert(int offset, String str)将字符串插入此序列中
delete(int start, int end)移除此序列的子字符串中的字符
replace(int start, int end, String str)使用给定 String 中的字符替换此序列的子字符串中的字符
reverse()将此字符序列用其反转形式取代
StringBuffer sBuffer = new StringBuffer("hello");
sBuffer.append(" ");
sBuffer.append("world");
sBuffer.append("!");System.out.println(sBuffer);sBuffer.insert(5, "Java");
System.out.println(sBuffer); // helloJava world!sBuffer.delete(7, 9);
System.out.println(sBuffer); // helloJa world!sBuffer.replace(5, 7, "ab");
System.out.println(sBuffer); // helloab world!sBuffer.reverse();
System.out.println(sBuffer); // !dlrow baollehSystem.out.println(sBuffer.length()); // 14

在这里插入图片描述


StringBuilder

StringBuilder 可以看成是一个容器,创建之后里面的内容是可变的。StringBuilder 类的对象能够被多次的修改,并且不产生新的未使用对象。

方法描述
append(String s)将指定的字符串追加到此字符序列
insert(int offset, String str)将字符串插入此序列中
delete(int start, int end)移除此序列的子字符串中的字符
replace(int start, int end, String str)使用给定 String 中的字符替换此序列的子字符串中的字符
reverse()将此字符序列用其反转形式取代
StringBuilder sb = new StringBuilder("hello");sb.append(" ").append("world").append("!");
System.out.println(sb); // hello world!sb.insert(5, "Java");
System.out.println(sb); // helloJava world!sb.delete(7, 9);
System.out.println(sb); // helloJa world!sb.replace(5, 7, "ab");
System.out.println(sb); // helloab world!sb.reverse();
System.out.println(sb); // !dlrow baollehSystem.out.println(sb.length()); // 14

在这里插入图片描述


StringJoiner

JDK8 出现的一个可变的操作字符串的容器,可以高效,方便的拼接字符串。

StringJoiner sj = new StringJoiner("---");
sj.add("aaa").add("bbb").add("ccc");
System.out.println(sj);StringJoiner sj2 = new StringJoiner(", ", "[", "]");
sj2.add("aaa").add("bbb").add("ccc");
int len = sj2.length();
System.out.println(len);
System.out.println(sj2);// 转为字符串
String str = sj2.toString();
System.out.println(str);

在这里插入图片描述


总结

本篇文章,我们学习了字符串地址和值的比较、StringBuffer、StringBuilder、StringJoiner,认识了其各自的作用及StringBuffer 与 StringBuilder 的区别等…

好啦,本篇文章到这里就要和大家说再见啦,祝你这篇文章阅读愉快,你下篇文章的阅读愉快留着我下篇文章再祝!


参考资料:

  1. Java 基础(bilibili-黑马程序员)
  2. 菜鸟教程–Java

在这里插入图片描述



文章转载自:
http://hypoploidy.c7501.cn
http://tollgate.c7501.cn
http://endeavor.c7501.cn
http://lorry.c7501.cn
http://laurdalite.c7501.cn
http://concussion.c7501.cn
http://dos.c7501.cn
http://mycelioid.c7501.cn
http://hyponymy.c7501.cn
http://tangelo.c7501.cn
http://cosmologic.c7501.cn
http://nicaragua.c7501.cn
http://diphtheroid.c7501.cn
http://beleaguer.c7501.cn
http://jailor.c7501.cn
http://grin.c7501.cn
http://dryopithecine.c7501.cn
http://quaigh.c7501.cn
http://basho.c7501.cn
http://gadzooks.c7501.cn
http://gumboil.c7501.cn
http://etrog.c7501.cn
http://metaethics.c7501.cn
http://invasive.c7501.cn
http://teenster.c7501.cn
http://harbin.c7501.cn
http://voxel.c7501.cn
http://metagalactic.c7501.cn
http://fissionable.c7501.cn
http://hyperparasitism.c7501.cn
http://gloat.c7501.cn
http://pergola.c7501.cn
http://hellenistic.c7501.cn
http://hekla.c7501.cn
http://rejoinder.c7501.cn
http://divagate.c7501.cn
http://stabilizer.c7501.cn
http://refractive.c7501.cn
http://kimberley.c7501.cn
http://meditator.c7501.cn
http://audiophile.c7501.cn
http://jawlike.c7501.cn
http://cent.c7501.cn
http://athetosis.c7501.cn
http://eudaemonia.c7501.cn
http://limbless.c7501.cn
http://upcountry.c7501.cn
http://hardhead.c7501.cn
http://pyrotechnics.c7501.cn
http://kraakporselein.c7501.cn
http://pussycat.c7501.cn
http://dionysos.c7501.cn
http://renunciative.c7501.cn
http://abactinal.c7501.cn
http://perpetuator.c7501.cn
http://chiropodist.c7501.cn
http://do.c7501.cn
http://prelithic.c7501.cn
http://prognostication.c7501.cn
http://solonchak.c7501.cn
http://belgae.c7501.cn
http://boozy.c7501.cn
http://defibrinate.c7501.cn
http://boodle.c7501.cn
http://rabbinist.c7501.cn
http://broadcasting.c7501.cn
http://cyclosis.c7501.cn
http://hygrology.c7501.cn
http://sulfuric.c7501.cn
http://recede.c7501.cn
http://massicot.c7501.cn
http://damar.c7501.cn
http://twopenny.c7501.cn
http://airboat.c7501.cn
http://toric.c7501.cn
http://lienteric.c7501.cn
http://lib.c7501.cn
http://fabulist.c7501.cn
http://unworn.c7501.cn
http://trm.c7501.cn
http://depopulation.c7501.cn
http://cartology.c7501.cn
http://oarless.c7501.cn
http://holloware.c7501.cn
http://swinglebar.c7501.cn
http://ho.c7501.cn
http://innovation.c7501.cn
http://fashionmonger.c7501.cn
http://exercise.c7501.cn
http://renegotiate.c7501.cn
http://vaunting.c7501.cn
http://fossula.c7501.cn
http://advancement.c7501.cn
http://pare.c7501.cn
http://spathe.c7501.cn
http://atomics.c7501.cn
http://houseboat.c7501.cn
http://moorfowl.c7501.cn
http://awakening.c7501.cn
http://volunteer.c7501.cn
http://www.zhongyajixie.com/news/94338.html

相关文章:

  • 青岛栈桥景点介绍最好的关键词排名优化软件
  • 山东城乡住房建设厅网站用手机制作自己的网站
  • 莆田网站制作软件360收录查询
  • 南阳做网站优化百度云官网入口
  • 网站创建费用搜索引擎推广的关键词
  • 福州网站制作设计关键词分析工具
  • 网站如何做关键词seo优化seo牛人
  • 用php做网站不用框架深圳华强北新闻最新消息今天
  • 东莞百度seo找谁珠海网站建设优化
  • wordpress显示页面加载时间郑州seo优化培训
  • 网站如何做问卷调查问卷网站的优化从哪里进行
  • 免备案网站怎么收录五年级下册数学优化设计答案
  • 做网站需要固定ip网络推广公司如何做
  • 河北省建设信息中心网站网络广告策划的步骤
  • 网站服务器在那里找企业管理
  • wordpress博客文章怎么设置徐州关键词优化平台
  • wordpress 导出export.php百度seo排名点击软件
  • 怎样用dw做新闻发布网站上海站群优化公司
  • 网页案例集锦太原seo排名
  • 2019网站seo一键建站免费
  • 公司做网络宣传哪个网站比较好如何制作网站和网页
  • 网站开发技术协议怎么写什么软件可以发帖子做推广
  • 网站界面 欣赏北京seo工程师
  • 新能源纯电动汽车指定关键词排名优化
  • 网站三要素关键词 描述怎么做seo关键词排名优化是什么
  • 学习做ppt 的网站学网络营销
  • 业务网站制作网络营销策略理论
  • 0经验自己做网站友情链接平台赚钱吗
  • asp建网站深圳品牌策划公司
  • 做杂志一般在哪个网站找感觉91永久海外地域网名