Advertisement
RazorBlade57

NumbreCompare

Nov 3rd, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. //© A+ Computer Science  -  www.apluscompsci.com
  2. //Name - Chris C
  3. //Date -
  4. //Class -
  5. //Lab  -
  6.  
  7. import static java.lang.System.*;
  8.  
  9. public class NumberCompare
  10. {
  11.     private int one, two;
  12.  
  13.     public NumberCompare()
  14.     {
  15.         one = 1;
  16.         two = 2;
  17.     }
  18.  
  19.     public NumberCompare(int n1, int n2)
  20.     {
  21.         one = n1;
  22.         two = n2;
  23.  
  24.     }
  25.  
  26.     public void setNums(int n1, int n2)
  27.     {
  28.         one = n1;
  29.         two = n2;
  30.  
  31.     }
  32.  
  33.     public int getLargest()
  34.     {
  35.         if(one>two)
  36.            return one;
  37.         else
  38.            return two;
  39.     }
  40.  
  41.     public int getSmallest()
  42.     {
  43.         if(two<one)
  44.             return one;
  45.         else
  46.         return one;
  47.     }
  48.  
  49.     public String toString()
  50.     {
  51.         getLargest();
  52.         getSmallest();
  53.         return "";
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement