- Java.lang - Void
- Java.lang - Throwable
- Java.lang - ThreadLocal
- Java.lang - ThreadGroup
- Java.lang - Thread
- Java.lang - System
- Java.lang - StringBuilder
- Java.lang - StringBuffer
- Java.lang - String
- Java.lang - StrictMath
- Java.lang - StackTraceElement
- Java.lang - Short
- Java.lang - SecurityManager
- Java.lang - RuntimePermission
- Java.lang - Runtime
- Java.lang - ProcessBuilder
- Java.lang - Process
- Java.lang - Package
- Java.lang - Object
- Java.lang - Number
- Java.lang - Math
- Java.lang - Long
- Java.lang - Integer
- Java.lang - InheritableThreadLocal
- Java.lang - Float
- Java.lang - Enum
- Java.lang - Double
- Java.lang - Compiler
- Java.lang - ClassLoader
- Java.lang - Class
- Java.lang - Character.UnicodeBlock
- Java.lang - Character.Subset
- Java.lang - Character
- Java.lang - Byte
- Java.lang - Boolean
- Java.lang - Home
Java.lang Package extras
Java.lang Package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.lang.Short Class
Introduction
The java.lang.Short class wraps a value of primitive type short in an object. An object of type Short contains a single field whose type is short.
Class Declaration
Following is the declaration for java.lang.Short class −
pubpc final class Short extends Number implements Comparable<Short>
Field
Following are the fields for java.lang.Short class −
static short MAX_VALUE − This is the constant holding the maximum value a short can have, 215-1.
static short MIN_VALUE − This is the constant holding the minimum value a short can have, -215.
static int SIZE − This is the number of bits used to represent a short value in two s complement binary form.
static Class<Short> TYPE − This is the Class instance representing the primitive type short.
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 |
Short(short value) This constructs a newly allocated Short object that represents the specified short value. |
2 |
Short(String s) This constructs a newly allocated Short object that represents the short value indicated by the String parameter. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method returns the value of this Short as a byte. |
2 | This method compares two Short objects numerically. |
3 | This method decodes a String into a Short. |
4 | This method returns the value of this Short as a double. |
5 | This method compares this object to the specified object. |
6 | This method returns the value of this Short as a float. |
7 | This method returns a hash code for this Short. |
8 | This method returns the value of this Short as an int. |
9 | This method returns the value of this Short as a long. |
10 | This method parses the string argument as a signed decimal short. |
11 | This method parses the string argument as a signed short in the radix specified by the second argument. |
12 | This method returns the value obtained by reversing the order of the bytes in the two s complement representation of the specified short value. |
13 | This method returns the value of this Short as a short. |
14 | This method returns a String object representing this Short s value. |
15 | This method returns a new String object representing the specified short. |
16 | This method returns a Short instance representing the specified short value. |
17 | This method returns a Short instance representing the specified short value. |
18 | This method returns a Short object holding the value extracted from the specified String when parsed with the radix given by the second argument. |
Methods inherited
This class inherits methods from the following classes −
java.lang.Object