// Creating an instance of the Car component
Object objectCar = xmulticomponentfactory.createInstanceWithContext(
"org.OpenOffice.Car", xcomponentcontext );
// Querying for the interface XAccelerationControl
XAccelerationControl xaccelerationcontrol = ( XAccelerationControl )
UnoRuntime.queryInterface( XAccelerationControl.class, objectCar );
// Print the current speed
System.out.println( "Current speed: " + Car._Car.getCurrentSpeed() );
// Speed up
xaccelerationcontrol.speedUp( 123.55 );
// Print the current speed
System.out.println( "Current speed: " + Car._Car.getCurrentSpeed() );
// Slow down
xaccelerationcontrol.slowDown( 112.43 );
// Print the current speed
System.out.println( "Current speed: " + Car._Car.getCurrentSpeed() );
// Querying for the interface XDrivingDirection