
- GWT Tutorial
- GWT - Home
- GWT - Overview
- GWT - Environment Setup
- GWT - Applications
- GWT - Create Application
- GWT - Deploy Application
- GWT - Style with CSS
- GWT - Basic Widgets
- GWT - Form Widgets
- GWT - Complex widgets
- GWT - Layout Panels
- GWT - Event Handling
- GWT - Custom Widgets
- GWT - UIBinder
- GWT - RPC Communication
- GWT - JUnit Integration
- GWT - Debugging Application
- GWT - Internationalization
- GWT - History Class
- GWT - Bookmark Support
- GWT - Logging Framework
- GWT Useful Resources
- GWT - Questions and Answers
- GWT - Quick Guide
- GWT - Useful Resources
- GWT - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
GWT Mock Test
This section presents you various set of Mock Tests related to GWT. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

GWT Mock Test II
Q 1 - Which of the following is true about Host Page in GWT?
Answer : C
Explaination
The most important public resource is host page which is used to invoke actual GWT application. A typical HTML host page for an application might not include any visible HTML body content at all but it is always expected to include GWT application via a <script.../> tag.
Q 2 - What is the default style name of any GWT widget?
Answer : A
Explaination
By default, the class name for each component is gwt-<classname>. For example, the Button widget has a default style of gwt-Button and similar way TextBox widgest has a default style of gwt-TextBox.
Answer : B
Explaination
No! By default, neither the browser nor GWT creates default id attributes for widgets.
Q 4 - What is the purpose of setStyleName() function of a GWT widget?
B - This method will add a secondary or dependent style name to the widget.
D - This method sets the object's primary style name and updates all dependent style names.
Answer : A
Explaination
setStyleName() method will clear any existing styles and set the widget style to the new CSS class provided using style.
Q 5 - What is the purpose of addStyleName() function of a GWT widget?
B - This method will add a secondary or dependent style name to the widget.
D - This method sets the object's primary style name and updates all dependent style names.
Answer : B
Explaination
addStyleName() method will add a secondary or dependent style name to the widget.
Q 6 - What is the purpose of removeStyleName() function of a GWT widget?
B - This method will add a secondary or dependent style name to the widget.
D - This method sets the object's primary style name and updates all dependent style names.
Answer : C
Explaination
removeStyleName() method will remove given style from the widget and leaves any others associated with the widget.
Q 7 - What is the purpose of setStylePrimaryName() function of a GWT widget?
B - This method will add a secondary or dependent style name to the widget.
D - This method sets the object's primary style name and updates all dependent style names.
Answer : D
Explaination
setStylePrimaryName() method sets the object's primary style name and updates all dependent style names.
Q 8 - Using which of the following way, you can attach a stylesheet to GWT application?
A - Using a <link> tag in the host HTML page.
Answer : C
Explaination
Using both of the above ways, a stylesheet can be attached to a GWT application.
Q 9 - Using which of the following way, you can attach a stylesheet to GWT application?
A - Using a CssResource contained within a ClientBundle.
B - Using an inline <ui:style> element in a UiBinder template.
Answer : C
Explaination
Using both of the above ways, a stylesheet can be attached to a GWT application.
Q 10 - Which of the following class is the superclass of all user-interface classes?
Answer : A
Explaination
The class UIObject is the superclass for all user-interface objects.
Q 11 - Which of the following is correct about UIObject class of GWT?
A - UIObject simply wraps a DOM element, and cannot receive events.
B - It provides direct child classes like Widget, MenuItem, MenuItemSeparator, TreeItem.
Answer : D
Explaination
All of the above options are correct.
Q 12 - Which of the following is correct about UIObject class of GWT?
B - More complex styling behavior can be achieved by manipulating an object's secondary style names.
Answer : C
Explaination
Both of the above options are correct.
Q 13 - Which of the following is correct about Widget class of GWT?
A - The class Widget is the base class for the majority of user-interface objects.
B - Widget adds support for receiving events from the browser and being added directly to panels.
Answer : C
Explaination
Both of the above options are correct.
Q 14 - Which of the following gwt widget contains text, not interpreted as HTML using a <div>element, causing it to be displayed with block layout?
Answer : A
Explaination
Label widget contains text, not interpreted as HTML using a <div>element, causing it to be displayed with block layout.
Q 15 - Which of the following gwt widget can contain HTML text and displays the html content using a <div> element, causing it to be displayed with block layout?
Answer : B
Explaination
HTML widget can contain HTML text and displays the html content using a <div> element, causing it to be displayed with block layout.
Q 16 - Which of the following gwt widget displays an image at a given URL?
Answer : C
Explaination
Image widget displays an image at a given URL.
Q 17 - Which of the following gwt widget represents a simple <a> element?
Answer : D
Explaination
Anchor widget represents a simple <a> element.
Q 18 - Which of the following gwt widget represents a standard push button?
Answer : A
Explaination
Button widget represents a standard push button.
Q 19 - Which of the following gwt widget represents a normal push button with custom styling?
Answer : B
Explaination
PushButton widget represents a normal push button with custom styling.
Q 20 - Which of the following gwt widget represents a stylish stateful button which allows the user to toggle between up and down states?
Answer : C
Explaination
ToggleButton widget represents a stylish stateful button which allows the user to toggle between up and down states.
Q 21 - Which of the following gwt widget represents a standard check box?
Answer : A
Explaination
CheckBox widget represents a standard check box. This class also serves as a base class for RadioButton.
Q 22 - Which of the following gwt widget represents a mutually-exclusive selection radio buttons?
Answer : D
Explaination
RadioButton widget represents a mutually-exclusive selection radio buttons.
Q 23 - Which of the following gwt widget represents a list of choices to the user, either as a list box or as a drop-down list?
Answer : B
Explaination
ListBox widget represents a list of choices to the user, either as a list box or as a drop-down list.
Q 24 - Which of the following gwt widget acts as a suggestion box?
Answer : C
Explaination
SuggestBox widget acts as a suggestion box. SuggestBox widget represents a text box or text area which displays a pre-configured set of selections that match the user's input. Each SuggestBox is associated with a single SuggestOracle. The SuggestOracle is used to provide a set of selections given a specific query string.
Q 25 - Which of the following gwt widget represents a single line text box?
Answer : D
Explaination
TextBox widget represents a single line text box.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | C |
2 | A |
3 | B |
4 | A |
5 | B |
6 | C |
7 | D |
8 | C |
9 | C |
10 | A |
11 | D |
12 | C |
13 | C |
14 | A |
15 | B |
16 | C |
17 | D |
18 | A |
19 | B |
20 | C |
21 | A |
22 | D |
23 | B |
24 | C |
25 | D |