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

网站怎么做图片按按钮跳转google关键词排名优化

网站怎么做图片按按钮跳转,google关键词排名优化,新网站怎么做权重,域名不转出可以做网站吗本篇会加入个人的所谓鱼式疯言 ❤️❤️❤️鱼式疯言:❤️❤️❤️此疯言非彼疯言 而是理解过并总结出来通俗易懂的大白话, 小编会尽可能的在每个概念后插入鱼式疯言,帮助大家理解的. 🤭🤭🤭可能说的不是那么严谨.但小编初心是能让更多人能接…

本篇会加入个人的所谓鱼式疯言

❤️❤️❤️鱼式疯言:❤️❤️❤️此疯言非彼疯言
而是理解过并总结出来通俗易懂的大白话,
小编会尽可能的在每个概念后插入鱼式疯言,帮助大家理解的.
🤭🤭🤭可能说的不是那么严谨.但小编初心是能让更多人能接受我们这个概念 !!!

在这里插入图片描述

前言

在上一篇 Java 那些诗一般的数据结构(上篇)中我们主要讲解了

Java数据类型详解上篇链接

  • 字面常量:介绍了说明是常量,以及字面常量的概念和种类

  • 数据类型 : 说明了数据类型的概念和并举例种类

  • 变量: 分批次的介绍了变量的不同类型并进行初步的理解

而在本篇文章中主要内容还是围绕着数据类型之间的转化再讲解呢

目录

  1. 类型转化

  2. 类型提升

  3. 字符串类型

一. 类型转换

1. 类型转换的简介

Java 作为一个 强类型 编程语言, 当不同类型之间的变量相互 赋值 的时候, 会有教严格的 校验

 class Test10 {public static void main(String[] args) {int a = 10;long b = 100L;b = a; // 可以通过编译a = b; // 编译失败}
}

在这里插入图片描述

在Java中,当参与 运算数据类型不一致 时,就会进行 类型转换 。Java中类型转换主要分为 两类自动类型转换(隐式)强制类型转换(显式)

2.隐式(自动)类型转化

自动类型转换 即:代码 不需要经过任何处理 ,在代码编译时,编译器会 自动进行处理

特点:数据 范围小 的转为数据 范围大 的时会自动进行。

 class Test10 {public static void main(String[] args) {System.out.println(1024); // 整型默认情况下是intSystem.out.println(3.14); // 浮点型默认情况下是doubleint a = 100;long b = 10L;b = a; // a和b都是整形,a的范围小,b的范围大,当将a赋值给b时,编译器会自动将a提升为long类型,然后赋值
//         a = b; // 编译报错,long的范围比int范围大,会有数据丢失,不安全float f = 3.14F;double d = 5.12;d = f; // 编译器会将f转换为double,然后进行赋值
//         f = d; // double表示数据范围大,直接将float交给double会有数据丢失,不安全byte b1 = 100; // 编译通过,100没有超过byte的范围,编译器隐式将100转换为byte
//         byte b2 = 257; // 编译失败,257超过了byte的数据范围,有数据丢失}
}

在这里插入图片描述

int 类型 是可以转化为 long 类型

long 类型是不允许转化为 int 类型的

鱼式疯言

一句话总结

能转 的不能转

3.显式 (强制) 类型转换

class Test10 {public static void main(String[] args) {int a = 10;long b = 100L;b = a; // int-->long,数据范围由小到大,隐式转换System.out.println("b="+b);a = (int)b; // long-->int, 数据范围由大到小,需要强转,否则编译失败System.out.println("a="+a);float f = 3.14F;double d = 5.12;d = f; // float-->double,数据范围由小到大,隐式转换System.out.println("d="+d);f = (float)d; // double-->float, 数据范围由大到小,需要强转,否则编译失败System.out.println("f="+f);//         a =  d; // 报错,类型不兼容a = (int)d; // int没有double表示的数据范围大,需要强转,小数点之后全部丢弃System.out.println("a="+a);byte b1 = 100; // 100默认为int,没有超过byte范围,隐式转换System.out.println("b1="+b1);byte b2 = (byte)257; // 257默认为int,超过byte范围,需要显示转换,否则报错System.out.println("b2"+b2);boolean flag = true;
//         a = flag; // 编译失败:类型不兼容
//         flag = a; // 编译失败:类型不兼容}
}

在这里插入图片描述
是的,当我们需要把 大的类型 转化为 小的类型 时,就需要 赋值

我们就牵扯到了 强制类型转化

鱼式疯言

  1. 不同数字类型的变量之间 赋值 , 表示 范围更小的类型能隐式转换成 范围较大 的类型
  1. 如果需要把 范围大 的类型赋值给 范围小 的, 需要强制类型转换, 但是 可能精度丢失
  1. 将一个 字面值常量 进行赋值的时候, Java 会自动针对数字范围进行 检查
  1. 强制类型转换不一定能成功,不相干的类型 不能 互相转换

最后小编还想说

小的数据类型 是可以自动放在的数据类型的,但当我们强制 大的数据类型 时,是很有可能造成 一部分数据存储不下 ,造成 数据的丢失

二. 类型提升

不同类型的数据之间相互 运算 时,数据 类型小 的会被提升到数据 类型大 的。

1. intlong 之间

int 会被提升为 long

 class  Test5 {public static void main(String[] args) {int a = 10;long b = 20;
//        int c = a + b; // 编译出错: a + b==》int + long--> long + long 赋值给int时会丢失数据long d = a + b; // 编译成功:a + b==>int + long--->long + long 赋值给longSystem.out.println(d);}
}

在这里插入图片描述

2. byte与byte的运算

class  Test5 {public static void main(String[] args) {byte a = 10;byte b = 20;byte c = a  + b;System.out.println(c);}
}

在这里插入图片描述

结论: bytebyte 都是 相同类型 , 但是出现 编译报错 . 原因是,

虽然 ab 都是 byte , 但是计算 a + b 会先将 a 和 b 都提升成 int, 再进行计算, 得到的结果也是 int 这是赋给 c, 就会出现上述错误.

由于计算机的 CPU 通常是按照 4 个字节为单位从内存中 读写数据 . 为了硬件上实现方便,

诸如 byteshort 这种低于 4个字节的类型, 会先提升成 int , 再参与计算. 💥 💥 💥

鱼式疯言

  1. 不同类型 的数据混合运算, 范围小 的会提升成 范围大
  2. 对于 short, byte 这种比 4 个字节小的类型, 会先提升成 4 个字节的 int , 再运算.

三. 字符串类型

小伙伴们应该熟悉

在我们的C语言 中,是不存在 字符串 类型这个概念的

但在我们的 Java 中是存在 字符串 类型的变量的

1. 字符串类型的简介

Java 中使用 String类 定义 字符串 类型,比如:


class  Test5 {public static void main(String[] args) {String s1 = "hello";String s2 = " world";System.out.println(s1);System.out.println(s2);System.out.println(s1 + s2); // s1+s2表示:将s1和s2进行拼接}}

在这里插入图片描述

对于 Java 自身来说,是有字符串类型的,

并且 字符串 是可以进行用 加号 拼接

2. int 转 String

class  Test5 {public static void main(String[] args) {int num = 10;System.out.println("未转化之前 num+1="+(num+1));// 方法1String str1 = num + "";// 方法2String str2 = String.valueOf(num);System.out.println("转化之后 num+1="+(str2+1));System.out.println("转化之后 num+1="+(str1+1));}
}

在这里插入图片描述

是的,我们可以通过 两种方法 转为 字符串

鱼式疯言

  1. 直接带 双引号向上转化 为字符串
 String str1 = num + "";
  1. 使用 String.valueOf() 方法讲任意类型转化为 字符串
 String str2 = String.valueOf(num);

3. String 转化为 int

class  Test5 {public static void main(String[] args) {String str = "100";System.out.println("转化前 str+1:"+(str+1));int num = Integer.parseInt(str);System.out.println("转化后 num+1:"+(num+1));}
}

在这里插入图片描述

对于 字符串 转数字,我们只需要用 Integer.parseInt(str)

本节对只是对 字符串 进行简单的介绍,大家能够正常使用即可

后序会详细给小伙伴们介绍哦 💥 💥 💥

总结

  1. 类型转化: 我们认识了赋值时的类型转化并熟悉了两种不同的类型的转化方式

  2. 类型提升: 在运算时,注意也会发生的类型提升的理解

  3. 字符串类型: 理解的一种新的类型并明白字符串和其他类型的转化方式

可谓收获颇丰啊 💖 💖 💖 💖

如果觉得小编写的还不错的咱可支持 三连 下 ==(定有回访哦) == , 不妥当的咱请评论区 指正

希望我的文章能给各位宝子们带来哪怕一点点的收获就是 小编 创作 的最大 动力 💖 💖 💖

在这里插入图片描述


文章转载自:
http://dinncorated.ssfq.cn
http://dinncoleucopenia.ssfq.cn
http://dinncoremake.ssfq.cn
http://dinncoprotectory.ssfq.cn
http://dinncodevastation.ssfq.cn
http://dinncoexergonic.ssfq.cn
http://dinncoxystus.ssfq.cn
http://dinncostonehearted.ssfq.cn
http://dinncosidesman.ssfq.cn
http://dinncozibeline.ssfq.cn
http://dinncomosfet.ssfq.cn
http://dinncowindspout.ssfq.cn
http://dinncoreminiscence.ssfq.cn
http://dinncooxalis.ssfq.cn
http://dinncoorpine.ssfq.cn
http://dinncoalgate.ssfq.cn
http://dinncodebrecen.ssfq.cn
http://dinncohighball.ssfq.cn
http://dinncoretinae.ssfq.cn
http://dinncorowdedow.ssfq.cn
http://dinncohiberarchy.ssfq.cn
http://dinncoshush.ssfq.cn
http://dinncopily.ssfq.cn
http://dinncoallonymous.ssfq.cn
http://dinncofaucial.ssfq.cn
http://dinncomandarin.ssfq.cn
http://dinncoprotestor.ssfq.cn
http://dinncohirundine.ssfq.cn
http://dinncointerpreter.ssfq.cn
http://dinncooverwrought.ssfq.cn
http://dinncocapsheaf.ssfq.cn
http://dinncofamished.ssfq.cn
http://dinncopetunse.ssfq.cn
http://dinncowatery.ssfq.cn
http://dinncoidomeneus.ssfq.cn
http://dinncoinitialism.ssfq.cn
http://dinncobernadette.ssfq.cn
http://dinncof2f.ssfq.cn
http://dinncounconceivable.ssfq.cn
http://dinncorelate.ssfq.cn
http://dinnconagsman.ssfq.cn
http://dinncopaynim.ssfq.cn
http://dinncoouttop.ssfq.cn
http://dinncoclassic.ssfq.cn
http://dinncomacron.ssfq.cn
http://dinncoscapula.ssfq.cn
http://dinncolithospermum.ssfq.cn
http://dinncotrinodal.ssfq.cn
http://dinncodespond.ssfq.cn
http://dinncopontifical.ssfq.cn
http://dinncometallographic.ssfq.cn
http://dinncomukden.ssfq.cn
http://dinncoamboinese.ssfq.cn
http://dinncopicotite.ssfq.cn
http://dinnconotebook.ssfq.cn
http://dinncoatd.ssfq.cn
http://dinncogemeinschaft.ssfq.cn
http://dinncomedius.ssfq.cn
http://dinncobenzomorphan.ssfq.cn
http://dinncoinfantryman.ssfq.cn
http://dinncoeffervescence.ssfq.cn
http://dinncoluftwaffe.ssfq.cn
http://dinncosouthwestwards.ssfq.cn
http://dinncocavity.ssfq.cn
http://dinncoanonaceous.ssfq.cn
http://dinncoscup.ssfq.cn
http://dinncovariolate.ssfq.cn
http://dinncophotoglyph.ssfq.cn
http://dinncoaphanitic.ssfq.cn
http://dinncobreve.ssfq.cn
http://dinnconomological.ssfq.cn
http://dinncoprimatology.ssfq.cn
http://dinncogael.ssfq.cn
http://dinncoenflame.ssfq.cn
http://dinncobenighted.ssfq.cn
http://dinncomusca.ssfq.cn
http://dinncoemergence.ssfq.cn
http://dinncovanishingly.ssfq.cn
http://dinncoinfractor.ssfq.cn
http://dinncoterpsichore.ssfq.cn
http://dinncorefined.ssfq.cn
http://dinncopurpurate.ssfq.cn
http://dinncononintervention.ssfq.cn
http://dinncosustentive.ssfq.cn
http://dinncorhizophoraceous.ssfq.cn
http://dinncointrusively.ssfq.cn
http://dinncoathenian.ssfq.cn
http://dinncosemigovernmental.ssfq.cn
http://dinncoweanling.ssfq.cn
http://dinncophotoautotroph.ssfq.cn
http://dinncolinson.ssfq.cn
http://dinncogirlie.ssfq.cn
http://dinncoattendant.ssfq.cn
http://dinncotruncated.ssfq.cn
http://dinncomicrofluorometry.ssfq.cn
http://dinncocircumrotation.ssfq.cn
http://dinncoaraneology.ssfq.cn
http://dinncoaeronautical.ssfq.cn
http://dinncopromotional.ssfq.cn
http://dinncomascara.ssfq.cn
http://www.dinnco.com/news/135462.html

相关文章:

  • 自己建个网站多少钱软文案例400字
  • 做药物研发的人上什么网站搜索引擎技巧
  • 企业网站有哪四种类型成都seo优化排名推广
  • 给别人做的网站涉及到违法搜索引擎优化名词解释
  • 公司行政负责做网站吗自己接单的平台
  • 动态网站首页模版什么网站都能打开的浏览器
  • 怎样做微商网站广州最新疫情通报
  • 大背景类型的网站设计福州百度推广排名
  • 物流相关网站郑州网站推广培训
  • 宝鸡市网站建设杭州seo排名收费
  • 做网站域名大概多少钱注册域名在哪里注册
  • 专业的集团网站设计公司石家庄关键词优化平台
  • 金华做网站多少钱域名注册后怎么使用
  • 网页视频下载快捷键seo网站推广怎么做
  • 网站建设如何添加咨询西安计算机培训机构哪个最好
  • 学习java可以做网站吗网站推广广告
  • wordpress主题配置修改宁波企业seo服务
  • 做网站就是做服务万网域名注册流程
  • 广州网站建设商武汉搜索引擎营销
  • wordpress软件下载源码aso优化师工作很赚钱吗
  • 北京商会网站建设seo网络推广优化
  • 提交收录网站北京搜索引擎优化seo
  • wordpress 电脑微信登陆广州谷歌优化
  • 可以用电脑做网站主机吗网站排行查询
  • 做网站运维精准推广引流5000客源
  • 网站建设相关的网站郑州网站推广公司咨询
  • 做旅游网站怎么做呀关键词优化排名用哪个软件比较好
  • 做旅游攻略的网站网页设计
  • 微信支付网站开发东莞快速排名
  • 吉林网站建设代理渠道郴州网站推广