About 272,000 results
Open links in new tab
  1. 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 …

  2. c# - Can I pass parameters by reference in Java? - Stack Overflow

    Jul 1, 2009 · In Java there is nothing at language level similar to ref. In Java there is only passing by value semantic. For the sake of curiosity you can implement a ref-like semantic in Java …

  3. pass by reference - C#'s ref and out in Java - Stack Overflow

    Java does not support passing primitive types by reference. Wrapping an int as an Integer won't help, since it is an immutable type (i.e. cannot be changed once created).

  4. c# - Can you pass by reference in Java? - Stack Overflow

    Mar 31, 2017 · The Java Developer was talking about passing a reference object, by value. Pass by reference could cause issues, however it provides solutions which could be applied (Look …

  5. C# equivalent to Java 8 "method reference" - Stack Overflow

    May 12, 2016 · Is there a C# equivalent to the Java 8 "method reference" in this case, given that I'm trying to get a property of each object (which in Java is done using a getProperty method)? …

  6. Java中替代C# ref/out 关键字方案: - hellenism - 博客园

    May 8, 2014 · 的第一反应就是C#中的ref/out关键字,结果发现Java中没有类似的关键字,所以只能想想如何解决此问题. 方法的参数传递有两种,一种是值传递,一种是引用传递,但是其实都是 …

  7. How Do C#'s `ref` and `out` Keywords Compare to Java's …

    In C#, use `ref` to pass an existing variable to a method allowing it to modify its value. Use `out` when you want to return multiple values from a method, ensuring the variable is initialized …

  8. Simulating C# ref Parameter in Java - CodeProject

    Nov 18, 2013 · Let’s try and simulate ‘ ref ’ using a generic class written this way: private T value; public Ref() { public Ref(T value) { this.value = value; public T getValue() { return value; public …

  9. Java to C#C# to Java. We bring you a much needed Rosetta

    Sep 6, 2019 · Java doesn’t actually pass by reference in method arguments. It can manipulate objects and variables by reference, but in a method, these arguments are passed by a value. …

  10. Java and C# Comparison and Equivalents

    Java does not support C#-style 'ref' parameters. All Java parameters are passed by value (if it's a reference, then the reference is passed by value). However, you can wrap the parameter type …

Refresh