title: How to pass int value from method to main()
body: <p>i want to ask about my java code, how to return int value from method to main() for display as print from main(), here the code i write but cannot print from main():</p>
  
  <pre><code>    package salaryemp;
  
  import java.util.Scanner;
  
  public class SalaryEmp {
  int hour_rate, normal, overt, t_normal, t_overt, all_t, otpr;
  
  
  SalaryEmp(int x,int z, int r){
  hour_rate =  x;
  normal = z;
  overt = r;
  }
  
  void Weekcount(){
  otpr = (hour_rate/2)+hour_rate;
  t_normal = normal*hour_rate;
  t_overt = overt*otpr;
  all_t = (t_normal + t_overt);  
  
  //Dont want print from this method, i want print from main()
  //System.out.println("Your salary for this week is RM: " + t_normal );
  //System.out.println("Your salary for this week is RM: " + t_overt );
  //System.out.println("Your salary for this week is RM: " + all_t );   
  
  }
  
  
  public static void main(String[] args) {
  
         Scanner input = new Scanner(System.in);
         int hourrate, tworkingh, tovertt;
         System.out.print("Insert hourly rate RM: ");
         hourrate = input.nextInt();
         System.out.print("Insert Total working hour : ");
         tworkingh = input.nextInt();
         System.out.print("Insert Total overtime hour : ");
         tovertt = input.nextInt();
         SalaryEmp s1 = new SalaryEmp(hourrate, tworkingh, tovertt);
  
         s1.Weekcount();
  
         //*Print result here
  
     }
  }
  </code></pre>
  
  <p>i new in java hope, can help me give some example or advices</p>