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