Object-oriented purists will argue that C# is 'more OO' than Java in a few ways. One can say that Java is not a pure OO language because it supports primitive types – and primitive types such as Java's int, long, and double are not real objects. (There is, however, a really good reason for not making your ints and longs objects. [1])
[1] Instantiating objects is an expensive process. When you want to perform a simple arithmetic addition, you want to perform the operation on the stack quickly and efficiently. Some programming languages do not have primitives; even integers are represented as objects. When two integers are to be added, two integer objects are actually created in the heap. The process is wasteful if all you want to do is to perform a simple arithmetic computation (in which case, there is no need to take advantage of the integer object's methods or properties).
So, we have a performance issue if we convert every little thing into objects. Anyway the Java core API includes nice wrapper classes for each of the eight Java primitive types if you really do need them. Read more in section 9.8.3.
In C#, everything can be treated like an object. Even your ints, chars, and longs – primitive types in C# (primitive types are known officially as 'simple types') – are also subclasses of System.Object together with all other C# classes.
Java types are grouped into two main categories:
primitive types (e.g. int i→i is a primitive variable);
object reference types (e.g. Object o;→o is an object reference variable).
In C#, all types are categorized into three groups:
pointer types
reference types
value types.
Table 9.1 shows a brief comparison between types in Java and C#. More detailed information about C# types follows.
Figure 9.1 shows how C# types are categorized.
3.12.136.119