Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //© A+ Computer Science - www.apluscompsci.com
- //Name - Chris C
- //Date -
- //Class -
- //Lab -
- import static java.lang.System.*;
- public class NumberCompare
- {
- private int one, two;
- public NumberCompare()
- {
- one = 1;
- two = 2;
- }
- public NumberCompare(int n1, int n2)
- {
- one = n1;
- two = n2;
- }
- public void setNums(int n1, int n2)
- {
- one = n1;
- two = n2;
- }
- public int getLargest()
- {
- if(one>two)
- return one;
- else
- return two;
- }
- public int getSmallest()
- {
- if(two<one)
- return one;
- else
- return one;
- }
- public String toString()
- {
- getLargest();
- getSmallest();
- return "";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement