IntClass - { IntClass temp = (IntClass) right; return (x -...

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

View Full Document Right Arrow Icon
public class IntClass extends PrimitiveTypeClass { 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) { x = x * num; } public int compareTo(PrimitiveTypeClass right)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { IntClass temp = (IntClass) right; return (x - temp.getNum()); } public boolean equals(PrimitiveTypeClass right) { IntClass temp = (IntClass) right; if (x == temp.getNum()) return true; else return false; } public String toString() { return (String.valueOf(x)); } }...
View Full Document

Ask a homework question - tutors are online