}}
__TOC__
== Contradiction ==
In [[{{PAGENAME}}#Features|section 1.1 Features]], it says that Java has a <code>Decimal128</code> data type:
{| class="wikitable" style="width:80%;"
|-
! style="width:40%;"|[[#Data types|Data types]]!! style="width:30%;"|Java !! style="width:30%;"|C#
|-
|IEEE 754 [[binary32]] floating point number||{{yes}}||{{yes}}
|-
|IEEE 754 [[binary64]] floating point number||{{yes}}||{{yes}}
|-
|'''High precision floating point number'''||{{yes|128-bit (28 digits) Decimal type}}||{{yes|128-bit (28 digits) Decimal type}}
|}
The simple answer, as stated in [[{{PAGENAME}}#Simple/primitive types|section 1.3.2 Primitive types]] is NO. Don't worry, I already fixed it. [[Special:Contributions/68.173.113.106|68.173.113.106]] ([[User talk:68.173.113.106|talk]]) 03:29, 2 March 2012 (UTC)
::I'm adding a "yes (BigDecimal class)". It's a class rather than a primitive, but it's part of standard Java. The distinction is arguably ignorable; e.g. you wouldn't say "scala has no number types at all" because they're all classes. <span style="font-size: smaller;" class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/94.174.207.151|94.174.207.151]] ([[User talk:94.174.207.151|talk]]) 06:09, 6 September 2012 (UTC)</span><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
:::BigDecimal was already represented in the table. Java does not have a simple/primitive type with high precision. It has a arbitrarily high precision type in the class library (which C# does not). All of this is represented in the table. [[User:Useerup|Useerup]] ([[User talk:Useerup|talk]]) 08:22, 13 September 2012 (UTC)
== Dubious claim about both languages not supporting arithmetic on all types ==
This claim is wrong. The issue illustrated by the examples is that the languages do not support byte ''literals'' - i.e. a sequence of digits form an ''integer'' literal - which cannot be cast to byte without loss. Consequently, invoking an arithmetic operator on a byte (variable) and an integer (literal) promotes the byte to integer (in *both* languages) and performs an integer operation. The result is an integer which - naturally - is not compatible with a byte.
The corresponding problem exists with the claim about the float type. Here the float gets promoted to a double - which is not assignment compatible with float/single.
I suggest removing this section as it is incorrect and misleading. [[User:Useerup|Useerup]] ([[User talk:Useerup|talk]]) 08:20, 13 September 2012 (UTC)
:On second thought I moved the section here so that we can correct it before deciding where (and if) it belongs in the article:
--- begin section ---
Both languages do not directly allow arithmetical operations on all primitive types, as they arbitrarily default to <code>int</code> or <code>double</code>:
{| class="wikitable"
|-
! Java !! C#
|-
|<source lang=Java>
byte value = 2;
float price = 5;
price++;
value++;
// Type mismatch: cannot convert from int to byte
value = value + 4; // <<<
value += 5;
// Type mismatch: cannot convert from double to float
price = 5.7; // <<<
</source>|| <source lang=CSharp>
byte value = 2;
float price = 5;
price++;
value++;
// Error: conversion from int to byte
value = value + 4; // <<<
value += 5;
// Error: conversion from double to float
price = 5.7; // <<<
</source>
|}
--- end section ---
== Platform Support ==
|