fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. try
  10. {
  11. int n = 2;
  12. int decimal = 23;
  13. double val = Double.parseDouble(n + "." + decimal);
  14. System.out.println(val);
  15. } catch (Exception e) //Or whatever exception
  16. {
  17. //Code
  18. }
  19. }
  20. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
2.23