- 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 property defines the invoked target of current project?
Answer : B
Explanation
ant.project.invoked-targets - Comma separated list of the targets that were invoked in the current project.
Q 2 - Which of the following property defines the base directory of current project?
Answer : C
Explanation
basedir - The basedir of the build, as specified in the basedir attribute of the project element.
Q 3 - Which of the following property defines the name of current project?
Answer : A
Explanation
ant.project.name - The name of the project, as specified in the name atrribute of the project element.
Q 4 - Which of the following is correct about fileset data type?
A - The fileset data types represents a collection of files.
B - It is used as a filter to include files that match a particular pattern.
C - It is used as a filter to exclude files that match a particular pattern.
Answer : D
Explanation
The fileset data types represents a collection of files. It is used as a filter to include or exclude files that match a particular pattern.
Q 5 - Which of the following is correct about fileset data type?
A - src attribute points to the source folder of the project.
Answer : C
Explanation
Both of the above options are correct.
Q 6 - Which of the following is correct about patternset data type?
A - A pattern set is a pattern that allows to filter files based on certain patterns.
B - A pattern set is a pattern that allows to filter folders based on certain patterns.
Answer : C
Explanation
A pattern set is a pattern that allows to filter files or folders easily based on certain patterns.
Q 7 - Which of the following is correct about ? meta character in patternset data type?
A - ? - Matches one character only.
B - ? - Matches zero or many characters.
Answer : A
Explanation
? - Matches one character only.
Q 8 - Which of the following is correct about * meta character in patternset data type?
A - * - Matches one character only.
B - * - Matches zero or many characters.
Answer : B
Explanation
* - Matches zero or many characters.
Q 9 - Which of the following is correct about ** meta character in patternset data type?
A - ** - Matches one character only.
B - ** - Matches zero or many characters.
Answer : C
Explanation
** - Matches zero or many directories recursively.
Q 10 - Which of the following is correct about patternset data type?
A - The patternset can be reused with a fileset.
Answer : A
Explanation
The patternset can be reused with a fileset.
Q 11 - Which of the following is correct about filelist data type?
A - filelist contains explicitly named lists of files.
Answer : C
Explanation
Both of the above options are correct.
Q 12 - Which of the following is correct about filelist data type?
A - filelist data type can be applied for existing files.
B - filelist data type can be applied for non-existing files.
Answer : C
Explanation
filelist data type can be applied for existing or non-existing files.
Q 13 - Which of the following is correct about path data type?
A - The path data type is commonly used to represent a class-path.
B - Entries in the path are separated using semicolons or colons.
Answer : D
Explanation
The path data type is commonly used to represent a class-path. Entries in the path are separated using semicolons or colons. However, these characters are replaced at the run-time by the executing system's path separator character.
Q 14 - Which of the following is correct about default project structure?
A - The database scripts are stored in the db folder.
B - The java source code is stored in the src folder.
C - The images, js, META-INF, styles (css) are stored in the war folder.
Answer : D
Explanation
All of the above options are correct.
Q 15 - Which of the following is correct about default project structure?
A - The JSPs are stored in the jsp folder.
B - The third party jar files are stored in the lib folder.
C - The java class files are stored in the WEB-INF\classes folder.
Answer : D
Explanation
All of the above options are correct.
Q 16 - Which of the following is correct about javadoc task?
A - javadoc task can be used to create java documentation.
B - Source can be specified using sourcepath, sourcepathref or sourcefiles attributes.
Answer : C
Explanation
javadoc task can be used to create java documentation. Source can be specified using sourcepath, sourcepathref or sourcefiles attributes.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | B |
2 | C |
3 | A |
4 | D |
5 | C |
6 | C |
7 | A |
8 | B |
9 | C |
10 | A |
11 | C |
12 | C |
13 | D |
14 | D |
15 | D |
16 | C |