Need Help With World Generation!

Hi every one i just need to ask something quick, How do i randomly generate cubes (endlessly). I cant figure it out can someone please help me with this please.