Java - Strings Class-String contentEquals() Method - Java

Description

This method returns true if and only if this String represents the same sequence of characters as specified in StringBuffer.

Syntax

Here is the syntax of this method −

Parameters

Here is the detail of parameters −

  • sb − the StringBuffer to compare.

Return Value

This method returns true if and only if this String represents the same sequence of characters as the specified in StringBuffer, otherwise false.

Example

This will produce the following result −

Output

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Java Topics