As of the Java Virtual Machine Specification second edition, numeric types, the boolean type (§3.3.4), and the returnAddress type are the three java primitive types supported by JVM.
Most of you may get annoyed, we all know about the primitives of java. That is where from we all started it. But, you may not be aware of a primitive called returnAddress. Surprise isn’t it? This post serves just to bring that primitive to your notice. It is not part of the language construct / api and is not of direct use to an application programmer. But it is good to be aware of the primitive for the sake of completeness.
Numeric types are classified as integral primitive and floating point type primitives
Integral type primitive:
byte – 8-bit signed two’s complement integers: -128 to 127 (-2power7 to 2power7 – 1)
short – 16-bit signed two’s complement integers: -32768 to 32767 (-2power15 to 2power15 – 1)
int – 32-bit signed two’s complement integers
long – 64-bit signed two’s complement integers
char – 16-bit unsigned integers representing Unicode characters (§2.1)
Value ranges from -2power(N-1) to 2power(N-1) – 1 ; where N is the bit size like 8 or 16,…
In the above, two’s complement means, a negative number will be denoted by the two’s complent of its absolute value. Most significat digit (MSB) will denote if the number is positive or negative. MSB will be 0 if the number is positive and 1 if it is negative.
Floating-point primitives are float and double
encode the truth values true and false. Even booleans are in turn processed using int instructions.
returnAddress types are pointers to the opcodes of JVM instructions like jsr, ret, and jsr_w
Comments are closed for "Java Primitive".
Good to see people blogging about Java, keep it up! I’m always interested to learn new things.
Just started reading your blog, nice articles. Kinda expected more on those returnAddress’s
Me too, didn’t really get the idea of returnAddresses.
Is there any use case for the java developer using returnAddress type?
Here explained that java primitives types are clearly explained and clear way of representation.And any of concept want to small program explanation….
Thank you
hi
it is really bunch of knowledge 1 can learn from.
Good Post. Want to know more about returnAddress with example.
it is mind-blowing….realy
Didn’t get idea about returnAddress ????
ya plss do explain it in detail.
Good Article.Hope to get more detailed info about return address
[…] in the above list, the primitives and reference types are treated differently. One popular cause of NullPointerException is accessing […]
Quite impressed !
awesome explanation
difference between a primitive type and non-primitive type….?
Note: i want reply form only joe… i don’t want to confuse myself with these discussions…
pls…
great post
great post
nice blog.. such a example i feel to better…
[…] toString() is a method that belongs to Object class. Every wrapper classes implements toString() method which returns a String object of the passed primitive. […]