Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

  public class Main {

      public static boolean isNumberWith2Decimals(String string) {
          return string.matches("^\\d+\\.\\d{2}$");
      }

public static void main(String[] args) {
sysout isNumberWith2Decimals("1234.123") 
    
}
  }