I think you should read a documentation about how the scene works, how to add dynamic joints and how to import geometry. This will allow you to set up a working car in V-REP which you can control through child scripts. Once that's done, you can connect to the remote API server with your Java client and control the car using V-REP signals.
If you want to detecect hitting an obstacle, you can probably attach some handler to collision detection but more simplistic approach might be to check some accelerometer data attached to the car.
I am sorry to not the exact links for documentation but I am sure you can find them around here.