Download Java.lang.Short.toString() Method Example

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
JAVA.LANG.SHORT.TOSTRING METHOD
http://www.tutorialspoint.com/java/lang/short_tostring.htm
Copyright © tutorialspoint.com
Description
The java.lang.Short.toString method returns a String object representing this Short value. The
value is converted to signed decimal representation and returned as a string
Declaration
Following is the declaration for java.lang.Short.toString method
public String toString()
Parameters
NA
Return Value
This method returns a string representation of the value of this object in base 10.
Exception
NA
Example
The following example shows the usage of java.lang.Short.toString method.
package com.tutorialspoint;
import java.lang.*;
public class ShortDemo {
public static void main(String[] args) {
// create short object and assign value to it
short sval = 50;
Short shortValue = new Short(sval);
// returns a String object representing this Short value.
System.out.println("Value is = " + shortValue.toString());
}
}
Let us compile and run the above program, this will produce the following result:
Value is = 50
Loading [MathJax]/jax/output/HTML-CSS/jax.js