Java Primitive

25/11/2010

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.

1) Numeric Types

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.

Ads by Google

Floating-point primitives are float and double

  • positive and negative sign-magnitude numbers
  • positive and negative zeros
  • positive and negative infinities
  • a special Not-a-Number value (used to represent zero/zero kind of numbers).

2) boolean type primitive

encode the truth values true and false. Even booleans are in turn processed using int instructions.

3) returnAddress type primitive

returnAddress types are pointers to the opcodes of JVM instructions like jsr, ret, and jsr_w

Ads by Google

14 comments on “Java Primitive

  1. Good to see people blogging about Java, keep it up! I’m always interested to learn new things.

  2. Just started reading your blog, nice articles. Kinda expected more on those returnAddress’s

  3. Me too, didn’t really get the idea of returnAddresses.

  4. Is there any use case for the java developer using returnAddress type?

  5. 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

  6. hi

    it is really bunch of knowledge 1 can learn from.

  7. Good Post. Want to know more about returnAddress with example.

  8. Didn’t get idea about returnAddress ????

  9. Good Article.Hope to get more detailed info about return address

  10. Pingback: Java Array

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

ABOUT
I am Joe, author of this blog. I run javapapers with loads of passion. If you are into java, you may find lot of interesting things around.
Ads by Google
STAY in TOUCH:

Email:

Core Java | Servlet | JSP | Design Patterns | Android | Spring | Web Service | © 2008-2012 javapapers.