Applets - Java test

Applets - Java test


1) Which is a special type of program that is embedded in the webpage to generate the dynamic content?

A) Package
B) Applet
C) Browser
D) None of the above
View Answer / Hide Answer

ANSWER: B) Applet




2) Applet runs inside the browser and works at client side?

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




3) In the following statements which is a drawback for Applet?

A) It works at client side so less response time
B) Secured
C) It can be executed by browsers running under many platforms, including Linux, Windows, and Mac Os etc.
D) Plugin is required at client browser to execute applet
View Answer / Hide Answer

ANSWER: D) Plugin is required at client browser to execute applet




4) The java.applet.Applet class 4 life cycle methods and java.awt.Component class provides how many life cycle methods for an applet?

A) 2
B) 3
C) 1
D) 4
View Answer / Hide Answer

ANSWER: C) 1




5) Which life cycle method of an applet java.awt.Component class provides?

A) public void paint(Graphics g)
B) public void destroy()
C) public void stop()
D) public void init()
View Answer / Hide Answer

ANSWER: A) public void paint(Graphics g)




6) Which is invoked after the init() method or browser is maximized?

A) public void start()
B) public void paint(Graphics g)
C) Public void stop()
D) Public void init()
View Answer / Hide Answer

ANSWER: A) public void start()




7) Which is the correct order for lifecycle of an applet?

A) Applet is intialized,started,painted,destroyed,stopped
B) Applet is painted,started,stopped,initilaized,destroyed
C) Applet is initialized,started,painted,stopped,destroyed
D) None of the above
View Answer / Hide Answer

ANSWER: C) Applet is initialized,started,painted,stopped,destroyed




8) To run an Applet which of these used?

A) By html file
B) By AppletViewer tool(for testing purpose)
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: C) Both A & B




9) Java Plug-in software is not responsible to manage the lifecycle of an Applet?

A) True
B) False
View Answer / Hide Answer

ANSWER: B) False




10) java.applet defines how many interfaces?

A) 2
B) 3
C) 4
D) 5
View Answer / Hide Answer

ANSWER: B) 3




11) Which Called when an applet begins execution, It is the first method called for any applet?

A) void init()
B) void destroy()
C) boolean isActive()
D) None of the above
View Answer / Hide Answer

ANSWER: A) void init()




12) When an applet begins, the AWT calls the following methods, in this sequence?

A) init(),paint(),start()
B) Start(),paint(),init()
C) intit(),start(),paint()
D) paint(),start(),init()
View Answer / Hide Answer

ANSWER: C) intit(),start(),paint()




13) when an applet is terminated the following sequence of methods calls takes place?

A) stop(),paint(),destroy()
B) destroy(),stop(),paint()
C) destroy(),stop()
D) stop(),destroy()
View Answer / Hide Answer

ANSWER: D) stop(),destroy()




14) This method is used to suspend threads that don’t need to run when the applet is not visible?

A) destroy()
B) paint()
C) stop()
D) start()
View Answer / Hide Answer

ANSWER: C) stop()




15) Which method is called only once during the run time of your applet?

A) stop()
B) paint()
C) init()
D) destroy()
View Answer / Hide Answer

ANSWER: C) init()




16) The APPLET tag is used to start an applet from both an HTML document and from an applet viewer?

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




17) Which is a required attribute that gives the name of the file containing your applet’s compiled .class file?

A) CODE
B) CODEBASE
C) ALT
D) NAME
View Answer / Hide Answer

ANSWER: A) CODE




18) Applet works at client side so less response time?

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




19) Applet runs inside the browser and does not works at client side?

A) True
B) False
View Answer / Hide Answer

ANSWER: B) False




20) In Applet which are common security restrictions?

A) Applets can't load libraries or define native methods
B) An applet can't read every system property
C) Applets can play sounds
D) Both A & B
View Answer / Hide Answer

ANSWER: D) Both A & B




21) Which Invoked immediately after the start() method, and also any time the applet needs to repaint itself in the browser?

A) stop()
B) init()
C) paint()
D) destroy()
View Answer / Hide Answer

ANSWER: C) paint()




22) An applet can play an audio file represented by the AudioClip interface in the java.applet package. The AudioClip interface has how many methods?

A) 2
B) 3
C) 1
D) 4
View Answer / Hide Answer

ANSWER: B) 3




23) An applet can play an audio file represented by the AudioClip interface in the java,applet package Causes the audio clip to replay continually in which method?

A) public void play()
B) public void loop()
C) public void stop()
D) None of the above
View Answer / Hide Answer

ANSWER: B) public void loop()




24) The following example shows the creation of a
import java.applet.*;
import java.awt.*;

public class Main extends Applet{
public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}
}

A) Banner using Applet
B) Basic Applet
C) Display clock
D) None of the above
View Answer / Hide Answer

ANSWER: B) Basic Applet




25) Applets cannot make network connection exception to the server host from which it originated?

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True


Post your comment