Can Create a New primitive datatype in Java

后端 未结 5 2138
闹比i
闹比i 2020-12-11 02:53

First thing I want to clarify here, this question is because of curiosity. I am not facing any issue.

There are many primitive types available in Java byte

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 03:32

    You all are wrong. Yes. You can. As a rule, you do not need a completely new primitive type. So, you don't need to rebuild JVM. Usually, you only need to "pack" or "cast" your new primitive type to an existing and define some operations like "+" with its wrapper.

    You can do it relatively simply with original JVM, but with your own Java compiler. Good luck!

提交回复
热议问题