Is Java's BigDecimal the closest data type corresponding to C#'s Decimal?

前端 未结 2 1452
温柔的废话
温柔的废话 2020-12-17 15:51

According to the chart here, the equivalent data type in Java to C#\'s Decimal is BigDecimal.

Is this really so? What\'s up with the \"Big\

2条回答
  •  粉色の甜心
    2020-12-17 16:34

    Yep - that's the corresponding type.

    Since you are using Java after C# - don't be too surprised to find little nuances like this - or be too upset when there is no easy way to do something that's "easy" to do C#. The first thing that comes to my mind is int & int? - in Java you just use int and Integer.

    C# had the luxury of coming after Java so lots of (what I subjectively see as) bad decisions have been fixed/streamlined. Also, it helps that C# was designed by Andres Hejlsberg (who is arguably one of the best programming language designers alive) and is regularly "updated" unlike Java (you probably witnessed all things added to C# since 2000 - complete list)

提交回复
热议问题