title: How to use return value from method in Java?
body: <p>I want to use the return value from a member function by storing it into a variable and then using it. For example:</p>
  
  <pre><code>public int give_value(int x,int y) {
    int a=0,b=0,c;
    c=a+b;
    return c;
  }
  
  public int sum(int c){ 
    System.out.println("sum="+c); 
  }              
  
  public static void main(String[] args){
      obj1.give_value(5,6);
      obj2.sum(..??..);  //what to write here so that i can use value of return c 
                         //in obj2.sum
  }
  </code></pre>