Jump to content

Define a primitive data type: Difference between revisions

m
→‎{{header|Java}}: Incorrect use of incorrect template
(→‎[[Defining Primitive Data Types#ALGOL 68]]: check that multiplication is possible for big integers.)
m (→‎{{header|Java}}: Incorrect use of incorrect template)
Line 331:
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|langJava|This doesn't actually create a primitive in Java. Also, many of the methods and constructors are the bound checks.}}
 
public class TinyInt{
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.