IntClass - { x = x * num; } public int compareTo(int num) {...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class IntClass { private int x; public IntClass() { x = 0; } public IntClass(int num) { x = num; } public void setNum(int num) { x = num; } public int getNum() { return x; } public void addToNum(int num) { x = x + num; } public void multiplyToNum(int num)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { x = x * num; } public int compareTo(int num) { return (x - num); } public boolean equals(int num) { if(x == num) return true; else return false; } public String toString() { return (String.valueOf(x)); } }...
View Full Document

Ask a homework question - tutors are online