Define a primitive data type: Difference between revisions

m (Moved to Basic learning)
Line 154:
=={{header|Java}}==
The closest you can get to defining a primitive type in Java is making a new wrapper class for yourself with methods for math operations. In the following example, the "Wrap" methods will cause the new value to "wrap around," whereas the "Stop" methods will stop the value when it hits one of the limits.
 
{{incorrect|lang|This doesn't actually create a primitive in Java. Also, many of the methods and constructors are the bound checks.}}
 
public class TinyInt{
int value;