Google

Interview Questions Test your java skills Java API Reference Notifications Java Forums Java Examples Tell a Friend
Link to us Donate
Javagalaxy.com WWW
Subscribe Un Subscribe

Java Interview Questions on your mobileNew            

Java Interview Questions - JavaGalaxy.com

  Java Interview Questions                       Is your Interview Question not answered here? Send it to webmaster@javagalaxy.com, we will answer it.

    Search Interview Questions 

  Displaying     Interview Questions and answers.

  Please click here to give us Feedback / Suggestions on how we can improve Java interview questions and answers

 
 Question   How do we pass a parameter from HTML page to Applet?  (Applets)  Discuss in Detail (QID: 632)
 Answer  Click on Discuss in Detail link for more details   [html]
[applet code="Launch.class" archive="bak.jar" width=740 height=460]
[param name="lang" value="English"]
[/applet]
[/html]

And within the init() of your applet, Use the following line to get the value.

String langs = getParameter("lang");

 Question   How are the differences between Applets and Applications?  (Applets)  Discuss in Detail (QID: 631)
 Answer  Click on Discuss in Detail link for more details   Application:

-Applications are Stand Alone and the doesn?t need web-browser.
-Execution starts with main().
-May or may not be a GUI.



Applets

-Needs no explicit installation on local machine. Can be transferred through Internet on to the local machine and may run as part of web-browser.
-Execution starts with init() method. Must run within a GUI (Using AWT / Swing)

 Question   What is the sequence for calling the methods by AWT for applets?  (Applets)  Discuss in Detail (QID: 630)
 Answer  Click on Discuss in Detail link for more details   When an applet begins, the AWT calls the following methods, in this sequence:
init()

start()

paint()

When an applet is terminated, the following sequence of method calls takes place

stop()

destroy()

 Question   What are the Applet's Life Cycle methods? Explain them?  (Applets)  Discuss in Detail (QID: 629)
 Answer  Click on Discuss in Detail link for more details   Following are methods in the life cycle of an Applet:

init() method - called when an applet is first loaded. This method is called only once in the entire cycle of an applet. This method usually intialize
the variables to be used in the applet

start() method - called each time an applet is started

paint() method - called when the applet is minimized or refreshed. This method is used for drawing different strings, figures, and images on the applet
window

stop() method - called when the browser moves off the applet?s page

destroy() method - called when the browser is finished with the applet

 Question   What is the difference between an Applet and an Application?  (Applets)  Discuss in Detail (QID: 548)
 Answer  Click on Discuss in Detail link for more details   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().

 Question   What are the problems faced by Java programmers who dont use layout managers?  (AWT)  Discuss in Detail (QID: 232)
 Answer    Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing system

 Question   Which Component subclass is used for drawing and painting?  (AWT)  Discuss in Detail (QID: 231)
 Answer  Click on Discuss in Detail link for more details   Canvas

 Question   What is a layout manager?  (AWT)  Discuss in Detail (QID: 230)
 Answer    A layout manager is an object that is used to organize components in a container

 Question   What interface is extended by AWT event listeners?  (AWT)  Discuss in Detail (QID: 229)
 Answer    All AWT event listeners extend the java.util.EventListener interface.

 Question   What is the difference between a Choice and a List?  (AWT)  Discuss in Detail (QID: 228)
 Answer    A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice. A List may be displayed in such a way that several List items are visible. A List supports the selection of one or more List items.

 
First Previous Showing 11 - 20 of 894 Records Next Last    Jump to page number       Current page number: 2

Displaying records per page

   - Discussions are available

Copyright © 2002 - 2010 JavaGalaxy.com,
All Rights Reserved Advertise| Feedback| Contact us| Terms of Use| Privacy Policy|

Help us to keep serving you better.
If you find any part of this site useful please support the site by linking to us