0

Variables in C and Java

In C language if you use the method in Java as a user defined function and it is called in a program, it directly referes to the function and return back the variable's value but why is the difference occurring in Java?

18th Jun 2019, 7:58 AM
CHIRANJEEVI
5 Answers
18th Jun 2019, 8:04 AM
Gordon
Gordon - avatar
0
https://code.sololearn.com/c80sJkw7BnEn/?ref=app see this
18th Jun 2019, 8:10 AM
CHIRANJEEVI
0
Try x = addOneTo(x); In C the same thing would happen unless you pass a pointer to x to the function
18th Jun 2019, 8:26 AM
Anna
Anna - avatar
0
So what you say is Variables in Java are pointers in C?
18th Jun 2019, 8:29 AM
CHIRANJEEVI