What syntax would I use to get the number of bytes representing a string and compare them to the number of bytes representing an ArrayList
holding that string, for
You can serialise each object into arrays and compare the length of each array. This is not very accurate, in the general case, but often gives a good approximation.
Have a look at ObjectOutputStream (which can be used to serialise an object and turn it into Bytes) and ByteArrayOutputStream (which can be used to hold the serialised bytes).