Java Short shortValue Example

Short class shortValue method example. This example shows you how to use shortValue method.


Short class shortValue method example. This example shows you how to use shortValue method. Method returns short value for specified Short instance.

Here is the code.
/**
 * @(#) ShortValueShort.java
 * A class representing use of method shortValue() of Short class in java.lang Package.
 * @Version  03-May-2008
 @author   Rose India Team
 */
class ShortValueShort{
  public static void main(String[] args){
    short shortNum = 123;
    Short shortObj = new Short(shortNum);
    
    //Method returns short value of given Short.
    short shortValue = shortObj.shortValue()
    System.out.println("short value of given Short is : " + shortValue);
  }
}

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US