I do not know about the java code, but ANY device that connects to a network will get its own IP address.
A wired connection is ONE DEVICE, a wireless connect is ONE DEVICE.
They DO NOT share the same hardware information and are just like to houses on the same property.
One house has an address and the other has a differant address.
Connecting a computer by both connections at the same time will give you two differant IP address's.
Why do you need to connect both at the same time?