Although I am not a big fan of using the out parameter in C #, I would like to know why Java did not include it in my language syntax. Is there any special reason or maybe it is because a person can simply pass an object as a type of parameter?
Java was designed as a simple language with very simple syntax - a kind of "Spartan OO language language" in C ++ with its abundance of functions that almost no one knows and does not fully understand (including compiler developers).
In principle, functions were omitted if they were not perceived as absolutely necessary.
, - , Java .
, , , Java . # .
.
, .
, generic ..
, # / Java, , , , # - .
№ 1 out - .
out
Java , .
ref. , CLR, "TryXXX" - . (a struct #):
struct
struct TryResult<T> { public T Result; public bool Succeeded; } TryResult<int> Parse(string intString) { ...
out .
Java .
, . , , , .
, Java # . , Java 15 . ( ) .
# . "Out" ( ), Java. Project Coin JDK7 , IIRC .
, - , ...
Java "" , ++? # -fu , , out - , . , Java ++ , ( IMHO ) . ++ , . , #, , . Java , ++, Java.
So where is the error of my paths? There must be a reason that no one has mentioned. I look forward to finding out what it is.
Source: https://habr.com/ru/post/1711277/More articles:In C #, how can I set a DataContext in a ViewModel? - c #Какой хороший проект/способ для того, чтобы разработчик С++ не успел вернуться к нему? - c++Display identical files with consecutive pages on a split screen Emacs - emacsКак сделать микро-шаблоны Resig совместимыми с XHTML? - javascriptУдаление нежелательных символов из текстового поля с помощью JQuery - javascriptHow do you disable DebuggerNonUserCodeAttribute from being placed on code generated by the dataset designer? - debuggingОбъясните небольшими словами, почему требуется IQueryable - .netDisplays controls based on the selected radio button - .netIs there an equivalent .htaccess file in file-based IIS6? (not config / plugin) - iisUsing "expect" to send password automatically - linuxAll Articles