Java Equivalent of a C++ Function

Правка en2, от dreamplay, 2017-08-17 19:26:39

I recently started learning basics of Java and got stuck on this doubt. How to write Java code for the below given C++ code. Note that making a class and passing an object or returning some object looks like a hack to me. So looking for other possible answers.

// c++ code
void f(int & x, int & y) {
    x++;y++;
}
f(x, y); // function call somewhere

Thanks

Теги #java, #c++

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский dreamplay 2017-08-17 19:26:39 0 (published)
en1 Английский dreamplay 2017-08-17 19:26:15 422 Initial revision (saved to drafts)