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
Primitive types are the ones defined by the language itself. In Java
you can only define new types as Classes
all derived from the common base class called Object
.
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!
You could, but then it wouldn't be Java anymore.
Simply No, You can not create primitive datatype.
Primitive datatype means which are provided and existed in language feature. Basically Java support this for performance reason and perform arithmetic operation.
You can create a user defined datatype using concept of class
and object
.
You cannot create your own primitive datatype.
As the Java documentation explains: A primitive type is predefined by the language and is named by a reserved keyword.