title: Converting C++ code to JAVA
body: <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  int fun(int *k);
  
  int main() {
      int i = 10, j = 10, sum1,sum2;
      sum1 = (i / 2) + fun(&amp;i);
      sum2 = fun(&amp;j) + (j / 2);
      cout&lt;&lt; sum1&lt;&lt; " "&lt;&lt;sum2&lt;&lt;endl;
  }
  
  int fun(int *k) {
      *k += 4;
      return 3 * (*k) - 1; 
  }
  </code></pre>
  
  <p>I have to convert my code to Java Code I already converted but i couldn't find my mistake i cannot point variables to each other..</p>
  
  <pre><code>public class System{
  
     public static void main(String[] args) {
        int i = 10;
        int j = 10;
        int sum1 = (i / 2) + fun(k.value=i);
        int sum2 = fun(k.value=j) + (j / 2);
        System.out.println("%d%d",sum1,sum2 );
     }
  
  
     public static int fun(int k) {
        intobj k;
        int k= new k();
        k.value += 4;
        return 3 * (k.value) - 1; 
     }
  }
  </code></pre>
  
  <p>This is my java code when i look at the int sum1 = (i / 2) + fun(k.value=i);
           int sum2 = fun(k.value=j) + (j / 2); part isn't true about point to true values. How can i solve that pointers problem. Thank you.</p>