Wednesday, 4 February 2015

Technical Round Applet Interview Questions and Answers (Part3)

11. What type of sound file formats can I use for the applets?
Java v1.02 only supports the "voice format" of the .au sound files. This is also know as "ยต-law, 8/16-bit, mono, 8000hz sample rate"

12. What is AppletStub Interface?
The applet stub interface provides the means by which an applet and the browser communicate. Your code will not typically implement this interface.

13. Which classes and interfaces does Applet class consist?
Applet class consists of a single class, the Applet class and three interfaces: AppletContext, AppletStub, and AudioClip.

14. Can applets on different pages communicate with each other?
Use the getSize() method, which the Applet class inherits from the Component class in the Java.awt package. The getSize() method returns the size of the applet as a Dimension object, from which you extract separate width, height fields. The following code snippet explains this:
Dimension dim = getSize();
int appletwidth = dim.width();
int appletheight = dim.height();

15. How do I select a URL from my Applet and send the browser to that page?
Ask the applet for its applet context and invoke showDocument() on that context object.
URL targetURL;
String URLString
AppletContext context = getAppletContext();
targetURL = new URL(URLString);
catch (MalformedURLException e)
// Code for recover from the exception
context. showDocument (targetURL);
More Questions & Answers :-
Part1  Part2  Part3  Part4  Part5

No comments:

Post a Comment