Code structure has evolved over time from early languages like Pascal and C to more modern languages like Java. Java introduced new ways of structuring code through object-oriented programming with classes and methods, as demonstrated through examples calculating a factorial and finding prime numbers. Overall, programming languages have advanced code structure by incorporating new paradigms that organize code in a more modular and reusable way.