: code tutorial (v3)

Lesson 5: Using Strings

Strings have always been and will always be special. That being said, the integration between Java and .NET is actually very simple.

In contrast to all other types, Java String is translated to C# string in the C# proxy types. This is a great convenience for you most of the time but has a few consequences that should almost never impact you.

On the plus side, you do not have to worry about converting a Java proxy String to a .NET string; the runtime does that for you automatically.

There are a couple of minuses:

We carefully weighed the advantaged and disadvantages and decided that the benefits in terms of usability outweighed the costs, which were largely theoretical. As a consequence, you can use .NET strings in any place where a Java String or Object is expected.