Questions et réponses d'entretien les plus demandées et tests en ligne
Plateforme d'apprentissage pour la preparation aux entretiens, les tests en ligne, les tutoriels et la pratique en direct

Developpez vos competences grace a des parcours cibles, des tests blancs et un contenu pret pour l'entretien.

WithoutBook rassemble des questions d'entretien par sujet, des tests pratiques en ligne, des tutoriels et des guides de comparaison dans un espace d'apprentissage reactif.

Preparation a l'entretien

Java Applet Questions et reponses d'entretien

Question 11. What is the difference between an Applet and an Application?

A Java application is made up of a main() method declared as public static void that accepts a string array argument, along with any other classes that main() calls. It lives in the environment that the host OS provides. A Java applet is made up of at least one public class that has to be subclassed from java.awt.Applet. The applet is confined to living in the user's Web browser, and the browser's security rules, (or Sun's appletviewer, which has fewer restrictions).  The differences between an applet and an application are as follows:
1. Applets can be embedded in HTML pages and downloaded over the Internet whereas Applications have no special support in HTML for embedding or downloading.
2. Applets can only be executed inside a java compatible container, such as a browser or appletviewer whereas Applications are executed at command line by java.exe or jview.exe.
3. Applets execute under strict security limitations that disallow certain operations(sandbox model security) whereas Applications have no inherent security restrictions.
4. Applets don't have the main() method as in applications. Instead they operate on an entirely different mechanism where they are initialized by init(),started by start(),stopped by stop() or destroyed by destroy().

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 12. How will you establish the connection between the servlet and an applet?

Using the URL, I will create the connection URL. Then by openConnection method of the URL, I will establish the connection, through which I can be able to exchange data.

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 13. How do we read number information from my applets parameters, given that Applets getParameter() method returns a string?

Use the parseInt() method in the Integer Class, the Float(String) constructor or parseFloat() method in the Class Float, or the

Double(String) constructor or parseDoulbl() method in the class Double.

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 14. How can I arrange for different applets on a web page to communicate with each other?

Name your applets inside the Applet tag and invoke AppletContext's getApplet() method in your applet code to obtain references to the other applets on the page.

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 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();
try
{
    targetURL = new URL(URLString);
}
catch (MalformedURLException e)
{
    // Code for recover from the exception
}
context. showDocument (targetURL);

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Les plus utiles selon les utilisateurs :

Copyright © 2026, WithoutBook.