Print Consecutive numbers by comparing two parameters
The function name is weird.  What is it testing?  A more appropriate name might be printInclusiveRange(…, …).

Since the bounds are inclusive, I would expect that for input 3,3, the output should be 3.  Yet you output nothing.

I would also expect the output not to end with a Tab character.

Here's one solution that corrects those two problems, and also combines the loops:

public static void printInclusiveRange(int a, int b) {
    System.out.print(a);
    if (a != b) {
        int i = a;
        int step = (a &lt; b) ? +1 : -1;
        do {
            i += step;
            System.out.print("\t" + i);
        } while (i != b);
    }
    System.out.println();  // Perhaps you want a newline here?
}