Java Output Formatting

  • + 0 comments

    After a sc.nextInt(); Statement when again for loop runs the first statement is reading a string So is it not possible that it will read an empty string? As we have heard that after reading int we should clear buffer or use empty sc.nextLine(); command. Please make me clear about why we do not need to clear buffer here? Thanks! your effort is appreciated.