Does Java have something like C#’s ref and out keywords?

No, Java doesn’t have something like C#’s ref and out keywords for passing by reference.

You can only pass by value in Java. Even references are passed by value. See Jon Skeet‘s page about parameter passing in Java for more details.

To do something similar to ref or out you would have to wrap your parameters inside another object and pass that object reference in as a parameter.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)