- Apache ANT Tutorial
- ANT - Home
- ANT - Introduction
- ANT - Environment Setup
- ANT - Build Files
- ANT - Property Task
- ANT - Property Files
- ANT - Data Types
- ANT - Building Projects
- ANT - Build Documentation
- ANT - Creating JAR files
- ANT - Create WAR Files
- ANT - Packaging Applications
- ANT - Deploying Applications
- ANT - Executing Java code
- ANT - Eclipse Integration
- ANT - JUnit Integration
- ANT - Extending Ant
- Apache ANT Useful Examples
- ANT - Using Token
- ANT - Using Command Line Arguments
- ANT - Using If Else arguments
- ANT - Custom Components
- ANT - Listeners and Loggers
- Apache ANT Resources
- ANT - Quick Guide
- ANT - Useful Resources
- ANT - Discussion
Ant Mock Test
This section presents you various set of Mock Tests related to Ant. 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.
Ant Mock Test
Q 1 - Which of the following is correct about javadoc task?
A - sourcepath is used to point to the folder of the source files (e.g. src folder).
C - sourcepath is used when you want to specify the individual files as a comma separated list.
Answer : A
Explanation
sourcepath is used to point to the folder of the source files (e.g. src folder).
Q 2 - Which of the following is correct about javadoc task?
A - sourcepathref is used to point to the folder of the source files (e.g. src folder).
C - sourcepathref is used when you want to specify the individual files as a comma separated list.
Answer : B
Explanation
sourcepathref is used to refer a path that is referenced by the path attribute (e.g, delegates.src.dir).
Q 3 - Which of the following is correct about javadoc task?
A - sourcefiles is used to point to the folder of the source files (e.g. src folder).
C - sourcefiles is used when you want to specify the individual files as a comma separated list.
Answer : C
Explanation
sourcefiles is used when you want to specify the individual files as a comma separated list.
Q 4 - Which of the following is correct about javadoc task?
A - destdir is used to specify the destination folder.
C - destdir is used when you want to specify the individual files as a comma separated list.
Answer : A
Explanation
destdir is used to specify the destination folder.
Q 5 - Which of the following task is used to create a jar file?
Answer : A
Explanation
jar task can be used to create a jar file.
Q 6 - Which of the following task is used to create a war file?
Answer : A
Explanation
war task can be used to create a war file.
Q 7 - Which of the following task is used to create a ear file?
Answer : A
Explanation
ear task can be used to create a ear file.
Q 8 - Which of the following attribute refers to base directory for the output JAR file?
Answer : B
Explanation
basedir - The base directory for the output JAR file. By default, this is set to the base directory of the project.
Q 9 - Which of the following is correct about compress attribute of jar task?
A - Advises Ant to compress the file as it creates the JAR file.
Answer : A
Explanation
Compress - Advises Ant to compress the file as it creates the JAR file.
Q 10 - Which of the following is correct about keepcompression attribute of jar task?
A - Advises Ant to compress the file as it creates the JAR file.
Answer : B
Explanation
keepcompression - While the compress attribute is applicable to the individual files, the keepcompression attribute does the same thing, but it applies to the entire archive.
Q 11 - Which of the following attribute refers to name of the output JAR file?
Answer : B
Explanation
destfile - The name of the output JAR file.
Q 12 - Which of the following is correct about excludes attribute of jar task?
A - Advises Ant to not include comma separated list of files in the package.
B - Advises Ant to not include pattern specified list of files in the package.
Answer : A
Explanation
Excludes - Advises Ant to not include comma separated list of files in the package.
Q 13 - Which of the following is correct about excludesfile attribute of jar task?
A - Advises Ant to not include comma separated list of files in the package.
B - Advises Ant to not include pattern specified list of files in the package.
Answer : A
Explanation
Excludes - Advises Ant to not include pattern specified list of files in the package.
Q 14 - Which of the following attribute refers of path of web.xml in war task?
Answer : A
Explanation
webxml - Path to the web.xml file.
Q 15 - Which of the following attribute refers of path of WEB-INF\lib in war task?
Q 15 - Which of the following attribute refers of path of WEB-INF\lib in war task?
Answer : B
Explanation
lib - A grouping to specify what goes into the WEB-INF\lib folder.
Q 16 - Which of the following attribute refers of path of WEB-INF\classes in war task?
Answer : C
Explanation
classes - A grouping to specify what goes into the WEB-INF\classes folder.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | A |
2 | B |
3 | C |
4 | A |
5 | A |
6 | A |
7 | A |
8 | B |
9 | A |
10 | B |
11 | B |
12 | A |
13 | A |
14 | A |
15 | B |
16 | C |