<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on"><b>Description:</b></p>
<p> This method has two different forms:</p>
<p></p>
<ul style="text-align: left;">
<li><b>public static String copyValueOf(char[] data):</b> Returns a String that represents the character sequence in the array specified.</li>
</ul>
<p></p>
<ul style="text-align: left;">
<li><b>public static String copyValueOf(char[] data, int offset, int count):</b> Returns a String that represents the character sequence in the array specified.</li>
</ul>
<p>
 <b>Syntax:</b></p>
<p> Here is the syntax of this method:</p>
<pre class="highlight" name="code">public static String copyValueOf(char[] data)

or

public static String copyValueOf(char[] data,
 int offset,
 int count)
</pre>
<p><b>Parameters:</b></p>
<p> Here is the detail of parameters:</p>
<p></p>
<ul style="text-align: left;">
<li>data &#8212; the character array.</li>
<li>offset &#8212; initial offset of the subarray.</li>
<li>count &#8212; length of the subarray.</li>
</ul>
<p>
 <b>Return Value :</b></p>
<p> This method returns a String that contains the characters of the character array.</p>
<p> <b>Example:</b></p>
<pre class="highlight" name="code">public class Test {

 public static void main(String args[]) {
 char[] Str1 = "This is really not immutable!!";
 String Str2;

 Str2 = copyValueOf( Str1 );
 System.out.println("Returned String " + Str2);

 Str2 = copyValueOf( Str1, 5, 10 );
 System.out.println("Returned String " + Str2);
 }
}
</pre>
<p>
This produces following result:</p>
<div style="background-color: #ff99cc;"><b>output:</b><br />
This is really not immutable!!<br />
is rea</div>
</div>
<div style="background-color: pink; border-width: thin; text-align: center;"><b><;<;<a href="https://dineshonjava.com/2013/02/string-class-in-java.html">Previous</a> <;<; ; ; || <a href="https://dineshonjava.com/2013/01/core-java-baby-step-to-be-best-java-ian.html">Index </a>||  ; >;>;<a href="https://dineshonjava.com/2013/03/java-string-endswith-method.html">Next</a> >;>;</b></div>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/java-string-contentequals-method/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/java-string-endswith-method/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '548'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…