25.02.2017 Views

java_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Java<br />

int result = str1.compareToIgnoreCase( str2 );<br />

System.out.println(result);<br />

result = str2.compareToIgnoreCase( str3 );<br />

System.out.println(result);<br />

}<br />

}<br />

result = str3.compareToIgnoreCase( str1 );<br />

System.out.println(result);<br />

This will produce the following result:<br />

0<br />

10<br />

-10<br />

Java – String concat() Method<br />

Description<br />

This method appends one String to the end of another. The method returns a String with<br />

the value of the String passed into the method, appended to the end of the String, used<br />

to invoke this method.<br />

Syntax<br />

Here is the syntax of this method:<br />

public String concat(String s)<br />

Parameters<br />

Here is the detail of parameters:<br />

<br />

s -- the String that is concatenated to the end of this String.<br />

Return Value<br />

<br />

This methods returns a string that represents the concatenation of this object's<br />

characters followed by the string argument's characters.<br />

146

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!