Share on Google+Share on Google+

short Java Keyword

The short is a keyword defined in the java programming language.

short Java Keyword


The short is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java programming language likewise the short keyword indicates the following :  

-- short is a Java primitive type.
-- A short type of  variable may store a 16−bit signed integer.
-- there is a wrapper class corresponding to a short primitive type which is known as the Short class. 
-- The Short wrapper class the defines MIN_VALUE and MAX_VALUE constants.
-- These constants represents the range of values for this type compatible with the short class according to the compiler compatability.
-- Please note that all the integer literals in Java programming language are 32−bit integer values unless they are followed by l or L as in 235L,
indicates that the value should be interpreted as a long.

Examples to use the Keyword short  to declare variables within a class

public class Class1{
short = 5;
short octalNumber = 0077;

short hexNumber = 0xff;


Posted on: November 17, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: short Java Keyword  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
February 24, 2012

write a brief short note on java