Fraction:
- toString(), returns string as a/b
This commit is contained in:
parent
d2b0d3c453
commit
225aa67765
@ -73,4 +73,8 @@ public class Fraction {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toString(){
|
||||||
|
return String.format("%d/%d", this.numerator, this.denominator);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user