I think that I have understood what you require. But before that let me point out that your do doesn't have an associated while.
If all that you wish to do is to print an appropriate message when the user enters an invalid integer, then you can catch the exception in the try catch block which will be automatically thrown by the calcRoot method. Your calcRoot method need not check if it is a String. If during run time, a String is passed instead of a number an exception will be generated automatically. So your code can simply be:
public static int calcRoot(int a)
{
return a=(int) Math.sqrt(a);
}
In the main method you need to catch the exception as it might be generated by the calcRoot function. This is how your code structure needs tolook like:
public static void main(String[] args)
{
// accept value from user
try
{
// call calcSqrt function here and add whatever you want
}
catch(NumberFormatException e)
{
// process error by displaying an appriate message or do anything else that you want to do
}
}