Top 20+ Advanced Java Applet Interview Questions 2020-21 - 2

Question: 6

When is update method called?

Whenever we minimize, maximize, restart the applet and explicitly calling the repaint() method in the code.

Repaint() method will implicitly call the update() method.

Question: 7

How will you initialize an Applet?

By including the initialization code in the init() method.

Question: 8

When do you use codebase in applets?

When the applet class file is not in the same directory, codebase is used.

Question: 9

Why does it take so much time to access an Applet having Swing components the first time?

Because behind every swing component are many Java objects and resources.

This takes time to create them in memory. JDK 1.3 from Sun has some improvements which may lead to faster execution of Swing applications.

Question: 10

How do you set security in applets?

Using setSecurityManager() method.

Related Questions