Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Java not use the out parameter in its language syntax while c# does?

Tags:

java

c#

While I am not a huge fan of using the out parameter in c# I would like to know why Java chose not to include it in its language syntax. Is there any special reason or maybe its because a person can simply pass an object as a parameter type?

like image 321
Draco Avatar asked Nov 29 '22 12:11

Draco


1 Answers

Probably because the designers didn't feel the need to allow for multiple ways of returning objects.

The same question can be asked about delegates, generic, etc.

But the fact of the matter is that the C# designers learned from Java's mistakes/inconveniences, which is why many I've spoken to feel C# is the nicer language to work with.

like image 130
hythlodayr Avatar answered Dec 05 '22 11:12

hythlodayr