List<Integer> digits(int i) {
List<Integer> digits = new ArrayList<Integer>();
while(i > 0) {
digits.add(i % 10);
i /= 10;
}
return digits;
}
More Related Contents:
- How to refacor a code use only loops and simple arrays?
- having an exception when saving oracle type object in some entity
- Java Getting values of 0 in Array
- What is the memory consumption of an object in Java?
- Update JLabel every X seconds from ArrayList – Java
- What causes “‘void’ type not allowed here” error
- What does the “static” modifier after “import” mean?
- Paginating text in Android
- Java GUI frameworks. What to choose? Swing, SWT, AWT, SwingX, JGoodies, JavaFX, Apache Pivot? [closed]
- Run a command over SSH with JSch
- leiningen – how to add dependencies for local jars?
- Throttling method calls to M requests in N seconds
- Sign CSR using Bouncy Castle
- How do I pass a variable from one Thread Group to another in JMeter
- How to use Jersey as JAX-RS implementation without web.xml?
- Spring session-scoped beans (controllers) and references to services, in terms of serialization
- Disable ok button on JOptionPane.dialog until user gives an input
- Is there a way to get count of number methods used in a jar file
- Convert Iterator to List
- Resources.openRawResource() issue Android
- Java Swing Timer and Animation: how to put it together
- Java; String replace (school project)?
- Uploadify plugin doesn’t call Java Servlet
- How to get element by Index in Spark RDD (Java)
- Text Extraction from HTML Java
- Understanding the difference between null and ‘\u000’ in Java
- java.util.logging.Logger doesn’t respect java.util.logging.Level?
- public static void main(String arg[ ] ) in java is it fixed?
- How to add rectangles on top of existing rectangle in canvas
- nested type cannot hide an enclosing type