fork(15) download
  1. class Ideone {
  2. public static void main (String[] args) {
  3. System.out.println(digit(98765, 2));
  4. }
  5.  
  6. static int digit(int a, int b) {
  7. while (--b > 0) {
  8. a /= 10;
  9. }
  10. return a % 10;
  11. }
  12. }
Success #stdin #stdout 0.06s 32360KB
stdin
Standard input is empty
stdout
6