my doubt is how the compile method can take two values
one when it is passed as actual argument
another after passed to method " st.pt1=((Pattern)ob).compile(s);"
compile is not taking two values, in the code ob1 is an instance of Pattern created using the Pattern method "compile(String regex)" then in the method getFormattedObject, the if statement determines that the object is an instance of Pattern. if true, then the Stores object pt1 will equal a Pattern object resulting from the compile(s) or compile("H[a-b][k-m").