04-03.eri-test Difference difference

10:30:11 on April 6, 2015 from blog. hazard. kr

1。==and !=operator

Net

Net has the same value of the comparison value of the ==overload 字符串等于.

Java

Java is slick, and due to its nature, the referrer is the same, the same, the same and the same is impossible.
Developers 字符串等于use it for developers .

2。 + operator

Net:

串s=“asd”+b+“qwe”; //>>串s=串。康卡特(“asd”,b,“ qwe”);

串 。cs
。NETconcat Principle

[System安全安全性安全关键]  //自动生成上市 静态的  Concat str0  str1 {// 合同는Test및유효성사검스를스클래스임。合同确保合同.结果<>() != 空值);合同.确保合同.结果</string><string>().长度 ==str0 == 空值  0 : str0.长度) +str1 == 空值  0 : str1.长度));Contract.EndContractBlock();如果 IsNullOr空的str0)) {如果 IsNullOrEmptystr1)) {返回 .Empty;}返回 str1;}如果 IsNullOrEmptystr1)) {返回 str0;}整型 str0长度 = str0.长度;//.NET네이티브를가다가포인터에이를자리자리자 结果 = FastAllocateString(str0Length + str1.Length);//그리고다가순서대로삽입FillStringChecked(结果 0str0);FillStringChecked(结果, str0Length, str1);//그리하여포인터。返回 结果;}

Java:

String s = "asd" + b + "qwe";
//>> String s = new StringBuffer().append("asd").append(b).append("qwe").toString();

StringBuffer.java
Java has a StringBufferdifference in principle that it has a string increment operator promise .

Merging String Advantages

插图: length by rimankeum reulreul mmm eumeumeum results Results gapeum eumeumeum eumeumeum eumeumeum
Java: StringBufferneed need need need to cut output reulreul Problem huhuhu Well eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum (default +16)

Consensus consensus

When adding a string in a loop, etc., the net StringBuilderand the Java are StringBufferprofitable.

So far.

from: https://dev.to//composite/-596p

Published 0 original articles · liked 0 · visits 124

Guess you like

Origin blog.csdn.net/cunbang3337/article/details/105560034