Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. public class Tra {
  2.  
  3. public static void main(String[] args) {
  4.  
  5. double value = 25.6;
  6. String strValue = String.valueOf(value);
  7. int dotIndex = strValue.indexOf(".");
  8.  
  9. System.out.println(strValue.substring(0,dotIndex));
  10. System.out.println(strValue.substring(dotIndex + 1));
  11. }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement