日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

没有值的json字符串_Java中具有原始数据类型值的字符串连接

發布時間:2023/12/1 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 没有值的json字符串_Java中具有原始数据类型值的字符串连接 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

沒有值的json字符串

Given a string and some of the primitive data type values, we have to concatenate them with the string in Java.

給定一個字符串和一些原始數據類型值,我們必須將它們與Java中的字符串連接起來。

In the example below, we have declared and initialized some of the primitive type of objects and a string object; we are adding the value of primitive types in the string object and printing the values of the result.

在下面的示例中,我們聲明并初始化了一些原始類型的對象和一個字符串對象; 我們將在字符串對象中添加基本??類型的值并打印結果的值 。

帶有原始數據類型值的字符串連接的Java代碼 (Java code for string concatenation with primitive data type values)

// Java code for string concatenation with // primitive data type valuespublic class Main {public static void main(String[] args) {boolean isMarried = false;boolean isQualified = true;int age = 21;double weight = 67.85;char gender = 'M';String name = "Shivang Yadav";String result = null;result = "isMarried: " + isMarried;System.out.println(result);result = "isQualified: " + isQualified;System.out.println(result);result = name + " is " + age + " years old.";System.out.println(result);result = name + " weight is " + weight + " kg.";System.out.println(result);result = "His gender is: " + gender;System.out.println(result);} }

Output

輸出量

isMarried: false isQualified: true Shivang Yadav is 21 years old. Shivang Yadav weight is 67.85 kg. His gender is: M

翻譯自: https://www.includehelp.com/java-programs/string-concatenation-with-primitive-data-type-values-in-java.aspx

沒有值的json字符串

總結

以上是生活随笔為你收集整理的没有值的json字符串_Java中具有原始数据类型值的字符串连接的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。