File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change 11import java .util .ArrayList ;
22
3- public class Digits
4- {
5-
3+ public class Digits {
64 private ArrayList <Integer > digitList ;
7-
8- public Digits (int num )
9- { /* to be implemented in part (a) */
10- digitList = new ArrayList <Integer >();
5+
6+ public Digits (int num ){
7+ /* to be implemented in part (a) */
8+ digitList = new ArrayList <Integer >();
119 if (num == 0 )
1210 digitList .add (0 );
1311 int n = num ;
1412 while (n > 0 ){
1513 digitList .add (0 , n %10 );
14+ n =n /10 ;
1615 }
17- n =n /10 ;
1816 }
1917
20- public boolean isStrictlyIncreasing ()
21- { /* to be implemented in part (b) */
18+ public boolean isStrictlyIncreasing (){
19+ /* to be implemented in part (b) */
2220 for (int i = 0 ; i < digitList .size () - 1 ; i ++)
2321 if (digitList .get (i +1 )<=digitList .get (i ))
2422 return false ;
2523 return true ;
26-
2724 }
2825
29- public String toString ()
30- {
26+ public String toString (){
3127 return digitList .toString ();
3228 }
3329}
You can’t perform that action at this time.
0 commit comments