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 />

Example<br />

public class Test {<br />

}<br />

public static void main(String args[]) {<br />

String s = "Strings are immutable";<br />

s = s.concat(" all the time");<br />

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

}<br />

This will produce the following result:<br />

Strings are immutable all the time<br />

Java – String contentEquals() Method<br />

Description<br />

This method returns true if and only if this String represents the same sequence of<br />

characters as specified in StringBuffer.<br />

Syntax<br />

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

public boolean contentEquals(StringBuffer sb)<br />

Parameters<br />

Here is the detail of parameters:<br />

<br />

sb -- the StringBuffer to compare.<br />

Return Value<br />

<br />

This method returns true if and only if this String represents the same sequence<br />

of characters as the specified in StringBuffer, otherwise false.<br />

147

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

Saved successfully!

Ooh no, something went wrong!