fork download
  1. /**
  2.  *
  3.  * @author Damien Bell <SkyeShatter@gmail.com>
  4.  */
  5.  
  6.  
  7. import java.util.Scanner;
  8. class Jtutorial1 {
  9. public static void main(String args[]){
  10. Scanner input = new Scanner(System.in);
  11.  
  12. int x =0 , y=0;
  13.  
  14. System.out.println("Enter a value for the first number: ");
  15. x = input.nextInt();
  16. System.out.println("Enter a value for the first number: ");
  17. y = input.nextInt();
  18.  
  19. int sum;
  20. sum = Prodsum.prodSum(x,y);
  21.  
  22. System.out.println("And the sum of the numbers is: "+ sum);
  23. } //End main
  24. } //End class
  25.  
  26.  
  27.  
  28. ///// ProdSum.java
  29.  
  30.  
  31.  
  32. /**
  33.  *
  34.  * @author Damien Bell <SkyeShatter@gmail.com>
  35.  */
  36.  
  37. public class Prodsum {
  38.  
  39. public static int prodSum(int x, int y){
  40. int sum;
  41.  
  42. System.out.println("The product is: " + (x*y));
  43. sum= x+y;
  44.  
  45. return sum;
  46. }//End prodSum
  47.  
  48. }//end class
  49.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty