Skip to main content

Java J2EE Interview Questions and Answers - Part 4

  1. What is an applet?- Applet is a dynamic and interactive program that runs inside a web page displayed by a java capable browser.
  2. What is the difference between applications and applets?- a)Application must be run on local machine whereas applet needs no explicit installation on local machine. b)Application must be run explicitly within a java-compatible virtual machine whereas applet loads and runs itself automatically in a java-enabled browser. d)Application starts execution with its main method whereas applet starts execution with its init method. e)Application can run with or without graphical user interface whereas applet must run within a graphical user interface.
  3. How does applet recognize the height and width?- Using getParameters() method.
  1. When do you use codebase in applet?- When the applet class file is not in the same directory, codebase is used.
  2. What is the lifecycle of an applet?- init() method - Can be called when an applet is first loaded start() method - Can be called each time an applet is started. paint() method - Can be called when the applet is minimized or maximized. stop() method - Can be used when the browser moves off the applet’s page. destroy() method - Can be called when the browser is finished with the applet.
  3. How do you set security in applets?- using setSecurityManager() method
  1. What is an event and what are the models available for event handling?- An event is an event object that describes a state of change in a source. In other words, event occurs when an action is generated, like pressing button, clicking mouse, selecting a list, etc. There are two types of models for handling events and they are: a) event-inheritance model and b) event-delegation model
  2. What are the advantages of the model over the event-inheritance model?- The event-delegation model has two advantages over the event-inheritance model. They are: a)It enables event handling by objects other than the ones that generate the events. This allows a clean separation between a component’s design and its use. b)It performs much better in applications where many events are generated. This performance improvement is due to the fact that the event-delegation model does not have to be repeatedly process unhandled events as is the case of the event-inheritance.
  3. What is source and listener?- source : A source is an object that generates an event. This occurs when the internal state of that object changes in some way. listener : A listener is an object that is notified when an event occurs. It has two major requirements. First, it must have been registered with one or more sources to receive notifications about specific types of events. Second, it must implement methods to receive and process these notifications.
  1. What is adapter class?- An adapter class provides an empty implementation of all methods in an event listener interface. Adapter classes are useful when you want to receive and process only some of the events that are handled by a particular event listener interface. You can define a new class to act listener by extending one of the adapter classes and implementing only those events in which you are interested. For example, the MouseMotionAdapter class has two methods, mouseDragged()and mouseMoved(). The signatures of these empty are exactly as defined in the MouseMotionListener interface. If you are interested in only mouse drag events, then you could simply extend MouseMotionAdapter and implement mouseDragged() .
  2. What is meant by controls and what are different types of controls in AWT?- Controls are components that allow a user to interact with your application and the AWT supports the following types of controls: Labels, Push Buttons, Check Boxes, Choice Lists, Lists, Scrollbars, Text Components. These controls are subclasses of Component.
  3. What is the difference between choice and list?- A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices and only one item may be selected from a choice. A List may be displayed in such a way that several list items are visible and it supports the selection of one or more list items.
  1. What is the difference between scrollbar and scrollpane?- A Scrollbar is a Component, but not a Container whereas Scrollpane is a Container and handles its own events and perform its own scrolling.
  2. What is a layout manager and what are different types of layout managers available in java AWT?- A layout manager is an object that is used to organize components in a container. The different layouts are available are FlowLayout, BorderLayout, CardLayout, GridLayout and GridBagLayout.
  3. How are the elements of different layouts organized?- FlowLayout: The elements of a FlowLayout are organized in a top to bottom, left to right fashion. BorderLayout: The elements of a BorderLayout are organized at the borders (North, South, East and West) and the center of a container. CardLayout: The elements of a CardLayout are stacked, on top of the other, like a deck of cards. GridLayout: The elements of a GridLayout are of equal size and are laid out using the square of a grid. GridBagLayout: The elements of a GridBagLayout are organized according to a grid. However, the elements are of different size and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes.

Comments

Popular Posts

DOT NET Interview Questions with Answers

When not to use Design Patterns?Do not use design patterns in any of the following situations.• When the software being designed would not change with time.• When the requirements of the source code of the application are unique.If any of the above applies in the current software design, there is no need to apply design patterns in the current design and increase unnecessary complexity in the design.When to use Design Patterns?Design Patterns are particularly useful in one of the following scenarios.• When the software application would change in due course of time.• When the application contains source code that involves object creation and event notification.Benefits of Design Patterns:The following are some of the major advantages of using Design Patterns in software development.• Flexibility• Adaptability to change• ReusabilityWhat are Design Patterns?A Design Pattern essentially consists of a problem in a software design and a solution to the same. In Design Patterns each pattern…

Job Posting - Assistant Managers / Deputy Managers / Managers for Designs.

Dear Colleagues,Our present employees are considered as a very important recruitment base and for some positions they are even the primary source of recruitment.We are looking for Assistant Managers / Deputy Manager / Managers for Designs division, to be based at Chennai / Hyderabad / Mumbai. The incumbent should be a self motivated and self driven team leader who can lead a team of engineers and draughtsmen. The job involves design of Cement Plant and allied structures for Indian and International clients.Interested candidates may apply by e-mail to SRRS-IN@flsmidth.com (for openings in Mumbai and Chennai) and to KKB-IN@flsmidth.com (for openings in Hyderabad) with their detailed CV on or before 10 Feb 2010.The details of the openings are as follows :PositionAssistant Managers / Deputy Managers / ManagersDepartmentDesignsJob ResponsibilityAllocating designs / drafting to juniors / draughtsmenProviding necessary inputs to enable them to do the allocated work.Checking of desi…

Walk-in interview on 27th March'10 in Bangalore @ TCS

Use this link, if unable to view the page Tata Consultancy Services (TCS) has endeavoured to help clients solve business challenges across diverse platforms and practices spread across multiple geographies. We, at TCS, offer you an opportunity to be a part of this dynamic team environment that is fulfilling, both professionally and personally.• "Industry Excellence Award 2008" (Institution of Engineers, India)
• "5-Year Multi-Million Dollar Deal" as ArvinMeritor's Global Engineering Partner
• "Best Use of Technology in Recruitment" (Recruiting and Staffing Best in Class -
     RASBIC Awards : 2009-2010)
Web Technologies

JAVA
– JAVA development experience

Microsoft Technologies (MS)

MOSS

.Net Designers
– Microsoft .Net, Oracle, IBM MQ
– Technical design experience
– Multi-engine/multithreading concepts
– Windows service experience

Business Intelligence / Knowledge Management (BI-KM)

Informatica Designer / Developer
– Informatica design / development experience

F…

.Net Framework Interview questions with answers

What do you know about BCL?The BCL (Base Class Library) is a combination of classes or we can say that it’s a library of functionalities and types available to all languages that used in .NET Framework. To make the programmer job more easier dot net gave a advantage to includes the BCL in order to collect a large number of common functions, just like to read a file and write to file, graphic rendering, database interaction, and XML document manipulation at one place . The scope of this is large and standard libraries for most other languages, including C++, and would be comparable in scope to the standard libraries is just like Java. The BCL is sometimes incorrectly referred to as the Framework Class Library (FCL), which is a superset including the Microsoft namespaces.In Assembly which work as GacBrowser ?The GACPicker class allows the user to select an assembly from the Global Assembly Cache. It does this by looking at the filesystem representation of the GAC, since there appears to…

ASP.NET 3.5 interview questions with answers

The IHttpHandler and IHttpHandlerFactory interfaces ?The IHttpHandler interface is implemented by all the handlers. The interface consists of one property called IsReusable. The IsReusable property gets a value indicating whether another request can use the IHttpHandler instance. The method ProcessRequest() allows you to process the current request. This is the core place where all your code goes. This method receives a parameter of type HttpContext using which you can access the intrinsic objects such as Request and Response. The IHttpHandlerFactory interface consists of two methods - GetHandler and ReleaseHandler. The GetHandler() method instantiates the required HTTP handler based on some condition and returns it back to ASP.NET. The ReleaseHandler() method allows the factory to reuse an existing handler.Does .NET CLR and SQL SERVER run in different process?Dot Net CLR and all .net realtes application and Sql Server run in same process or we can say that that on the same address be…

Wipro Infotech Walk-in for Freshers: Oct 31

Freshers IT Job Opening at Wipro InfotechExperience: 0 - 1 Years

Location: Pune

Education:
UG - Any Graduate - Any Specialization  
PG - Any PG Course - Any Specialization

Industry Type: IT-Hardware & Networking

Functional Area: IT-Support, Telecom, Hardware
Job Description:
Walk-in on 31st October at  Wipro Limited 5th Floor, C-Wing, Godrej Eternia, Old Pune - Mumbai Road, Near Shopper's Stop, Shivajinagar, Pune

Timings- 10:00am - 4:00pm



Contact person - Deepa Raman

Wipro is looking for candidates with 6 months to 1 year experience who can join immediately. The role will be on direct contract with Wipro.



Skills Required -
* Good communication & grammatical skills
* Basic understanding of networking terminologies
* Knowledge of workflow management tools like Clarify and Remedy would be desired
* Candidate should be willing to work in a 24/7 shift


Desired Candidate Profile
Walk-in on 31st October at Wipro Limited 5th Floor, C-Wing, G…

Contact Form

Name

Email *

Message *