<div dir="ltr" style="text-align: left;" trbidi="on"><b>Description:</b></p>
<p> This method has followings variants which depends on the passed parameters. This method returns the string representation of the passed argument.</p>
<p></p>
<ul style="text-align: left;">
<li><b>valueOf(boolean b):</b> Returns the string representation of the boolean argument.</li>
<li><b>valueOf(char c) :</b> Returns the string representation of the char argument.</li>
<li><b>valueOf(char[] data) : </b>Returns the string representation of the char array argument.</li>
<li><b>valueOf(char[] data, int offset, int count) :</b> Returns the string representation of a specific subarray of the char array argument.</li>
<li><b>valueOf(double d) :</b> Returns the string representation of the double argument.</li>
<li><b>valueOf(float f) : </b>Returns the string representation of the float argument.</li>
<li><b>valueOf(int i) :</b> Returns the string representation of the int argument.</li>
<li><b>valueOf(long l) :</b> Returns the string representation of the long argument.</li>
<li><b>valueOf(Object obj) :</b> Returns the string representation of the Object argument.</li>
</ul>
<p>
 <b>Syntax:</b></p>
<p> Here is the syntax of this method:</p>
<pre class="highlight" name="code">static String valueOf(boolean b) 

or 

static String valueOf(char c) 

or

static String valueOf(char[] data) 

or

static String valueOf(char[] data, int offset, int count) 

or

static String valueOf(double d) 

or

static String valueOf(float f) 

or

static String valueOf(int i)

or

static String valueOf(long l)

or

static String valueOf(Object obj) 
</pre>
<p>
<b>Parameters:</b></p>
<p> Here is the detail of parameters:</p>
<p></p>
<ul style="text-align: left;">
<li>See the description.</li>
</ul>
<p>
 <b>Return Value :</b></p>
<p></p>
<ul style="text-align: left;">
<li>This method returns the string representation.</li>
</ul>
<p>
 <b>Example:</b></p>
<pre class="highlight" name="code">import java.io.*;

public class Test{
 public static void main(String args[]){
 double d = 102939939.939;
 boolean b = true;
 long l = 1232874;
 char[] arr = {'a', 'b', 'c', 'd', 'e', 'f','g' };

 System.out.println("Return Value : " + String.valueOf(d) );
 System.out.println("Return Value : " + String.valueOf(b) );
 System.out.println("Return Value : " + String.valueOf(l) );
 System.out.println("Return Value : " + String.valueOf(arr) );
 }
}
</pre>
<p>
This produces following result:</p>
<div style="background-color: #ff99cc;"><b>output:</b><br />
Return Value : 1.02939939939E8<br />
Return Value : true<br />
Return Value : 1232874<br />
Return Value : abcdefg</div>
<p></p>
<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/02/objects-and-classes-in-java.html">Next</a> >;>;</b></div>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/java-string-trim-method/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/singleton-pattern-in-java/">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: '522'});
});
</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…