HackerEarth Girlfriend's Demand challenge, solved two ways
Slowness caused by System.out.println
The difference between the first and second programs isn't the parsing or long/int conversion.  The difference is that in the first program, you use a StringBuffer to build your output into one big string (which is good).  In the second program, you call System.out.println() for each of your 100000 lines of output.  This takes a significant amount of time.
The current code
I don't see any problem with your first program.  It runs about as well as can be expected.  There are some strange indentations in your code and a few places where I would have added some spaces, but otherwise I don't see other problems.  I played around with it and got it to run about 8% faster by changing the parsing, but it wasn't really significant.  For your reference, here is the modified code:
public static void main(String args[] ) throws Exception {
    BufferedReader br        = new BufferedReader(
                                    new InputStreamReader(System.in));
    String         item      = br.readLine();
    int            len       = item.length();
    int            numInputs = Integer.parseInt(br.readLine());
    StringBuffer   output    = new StringBuffer(numInputs * 4);

    while (numInputs-- &gt; 0) {
        String line  = br.readLine();
        int    space = line.indexOf(' ');
        long   a     = Long.parseLong(line.substring(0, space-1));
        long   b     = Long.parseLong(line.substring(space+1));

        a = (a-1) % len;
        b = (b-1) % len;

        if (item.charAt((int)a) == item.charAt((int)b))
            output.append(&quot;Yes\n&quot;);
        else
            output.append(&quot;No\n&quot;);
    }

    System.out.println(output);
}