Sharp GP2Y0D810Z0F how to use?

I bought a IR-Distance Sensor (Sharp GP2Y0D810Z0F),

A link is worth, well maybe not a thousand, but certainly a bunch.

how can I use it?

Connect it to some pins and write some code.

The data sheet says the operating voltage is 4,8 - 6V, my Arduino Uno has got 5V output,

Perfect.

but some people I've seen are using a resistor for it, is that needed?

Yes. No, wait, no. No, wait, we need a link to the data sheet.

How can I read out the distance and print it on the screen (i've seen a java like output-console, how can I use that?)

We need to see the data sheet to answer part 1. Serial.print() for part 2. No idea what "java-like" console you are talking about.

Java is a programming language. How can a console window be java-like? That would be like being C++-like or C#-like or VB-like.