Advertisement
lowdensh

Adding integers

Oct 6th, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. // Adding integers
  2.  
  3.  
  4.  
  5. import javax.swing.*;
  6.  
  7.  
  8.  
  9. class tAddIntegers
  10.  
  11. {
  12.  
  13.     public static void main(String[] param)
  14.  
  15.     {
  16.  
  17.         int num1 = 20,
  18.  
  19.             num2 = 10,
  20.  
  21.             num3 = 19,
  22.  
  23.             numTotal = num1 + num2 + num3;
  24.  
  25.         JOptionPane.showMessageDialog(null,
  26.  
  27.             "The total of " + num1 + ", " + num2 + " and " + num3 + " is " + numTotal + ".");
  28.  
  29.         return;
  30.  
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement