short keyword in java

" short" is a Java primitive type.

A short variable can store a 16−bit integer.


short height=6;
short width=12;

The short keyword can be used as a method parameter as below:

  1. public void displayHeight(short height) {
  3.     System.out.println("Height is "+height);
  4. }
public void displayHeight(short height) {

    System.out.println("Height is "+height);

The short keyword can be used as a return type of a method as well:

  1. public short getWidth() {
  2.  short width=12;
  3.  return width;
  4. }
public short getWidth() {
 short width=12;
 return width;

About the Author

Karibasappa G C (KB)
Founder of
I love Java and open source technologies and very much passionate about software development.
I like to share my knowledge with others especially on technology 🙂
I have given all the examples as simple as possible to understand for the beginners.
All the code posted on my blog is developed,compiled and tested in my development environment.
If you find any mistakes or bugs, Please drop an email to

Connect with me on Facebook for more updates

Share this article on