Something like the following:
ref example:
void changeString(ref String str) {
str = \"def\";
}
void main() {
String abc = \"abc\";
chan
Direct answer: No
But you can simulate reference with wrappers.
And do the following:
void changeString( _ str ) {
str.s("def");
}
void testRef() {
_ abc = new _("abc");
changeString( abc );
out.println( abc ); // prints def
}
Out
void setString( _ ref ) {
str.s( "def" );
}
void testOut(){
_ abc = _();
setString( abc );
out.println(abc); // prints def
}
And basically any other type such as:
_ one = new (1);
addOneTo( one );
out.println( one ); // May print 2