Java Primitive

Java Primitive

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.

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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值