No, you cannot define your own primitive types for numeric values.
The Price myPrice means that the variable myPrice will be of type Price and will be used as an instance of it.
You can have a valid one.
Suppose you declare a variable myPrice type Price . Some instance variables can be accessed via this myPrice link.
Price myPrice = new Price(); myPrice.value = 10.0; myPrice.currency = "Dollar"; etc ....
source share