I'm sure you meant disk space instead of RAM perhaps? I think it would be overkill to obtain a Mac with 256 GB or 1 TB of RAM just to create iOS Apps. ;)
Even though OP said they are a Java developer, I would strongly urge going with Kotlin for Android at this point. Kotlin replaced Java as the default language for native Android development in 2017, and new code samples are being written in Kotlin. At the very least, start with Java, and ease your way into Kotlin, since it's 100% interoperable with Java. Aside from being the default Android langauge, Kotlin has many other benefits.
Benefit is that you can develop on Windows, Mac, or Linux, won't have to buy an iDevice or two, or a new machine.
Surely you mean disk space, not RAM?
Only once you’d like to publish your app on the App Store.
I did not realize this. Sad :(