Cisco interview question

Explain the scenario where we use scripting instead of Java programming and advantages?