I'm trying to return a part of a number, like so:

```
int foo = 123456789;

System.out.println( foo[0-3] ); //123

```

I'd also like to get a slice of the number for different indexes, from 2 to 5 for example. In Python, it is pretty straightforward but for some reason it's not so easy to do the same in Java.