Java probability if 2 integers are coprime
This review is for the code only, not the optimization / correctness; I assume the code works as IS.
Avoid using C-style array declaration
In the main method, you declared a C-style array declaration with the args variable.
before
String args[]

after
String[] args

In my opinion, this style is less used and can cause confusion.
Always add curly braces to loop &amp; if
In my opinion, it's a bad practice to have a block of code not surrounded by curly braces; I saw so many bugs in my career related to that, if you forget to add the braces when adding code, you break the logic / semantic of the code.
Before
if (b == 0)
   return a;
else
   return myTestMethod(b, a % b);

After
if (b == 0) {
   return a;
} else {
   return myTestMethod(b, a % b);
}

Other things
To save space in the main method, you can inline the variable y and p
//[...]
int y = (myTestMethod(a, b));
//[...]
float p = (myTestMethod(a, b));
//[...]

You can take less lines for the printing in the main method
You can make a printing method
public static void main(String[] args) {
   if (y == 1) {  //if gcd is 1 the probability should be 1
      printMultiLine(&quot;probability is:&quot;, p);
   } else { //else print probability as p/100.
      printMultiLine(&quot;The probability is :&quot;, p / 100);
   }
}

private static void printMultiLine(String message, float value) {
   System.out.println(message);
   System.out.println(value);
}

or
You can uses java.io.PrintStream#printf
java.io.PrintStream#printf offer you to use patterns to build the string without concatenating it manually. The only downside is you will be forced to add the break line character yourself; in java you can use the %n to break the line (portable between various platforms) or uses the traditional \n / \r\n.
public static void main(String[] args) {
   //[...]
   if (y == 1) {  //if gcd is 1 the probability should be 1
      System.out.printf(&quot;probability is:%n%f&quot;, p);
   } else { //else print probability as p/100.
      System.out.printf(&quot;The probability is:%n%f&quot;, p / 100);
   }
}