Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Wednesday, October 2, 2013

Java - Access restriction rt.jar

  • Go to the Build Path settings in the project properties.
  • Remove the JRE System Library

  • Add it back; Select "Add Library" and select the JRE System Library

  • Source:
  • http://stackoverflow.com/questions/860187/access-restriction-on-class-due-to-restriction-on-required-library-rt-jar
  • Tuesday, May 14, 2013

    Java - Number/Date Formating

    Number Formating

     
    String number = "1000500000.574";
    double amount = Double.parseDouble(number);
    DecimalFormat formatter = new DecimalFormat("#,###.00");
    System.out.println(formatter.format(amount));
     
    Result: 
    1,000,500,000.57 
    
    
    20 --> DecimalFormat("###.0"); result: 20.0
     

    Thursday, April 18, 2013