Ant interview questions
Explain the concepts and capabilities of ANT.
Latest answer: Capabilities of ANT: ANT tool is extended by
using java classes. The configuration files are XML-based. Each task of
building directory tree is executed by using the object that implements the
Task interface.............
Read answer
Latest answer: Before start using ant, we should be clear about
the project name and the .java files and most importantly, the path where the
.class files are to be placed...............
Read answer
Latest answer: The following is the code snippet to set the
classpath in ant:
<path id=”build.classpath”>
<fileset dir=”${build.lib}”
includes=”**/*.jar/>
<fileset dir=”${build.class”}/>
</path>.................
Read answer
Latest answer: Properties in ant are set in an order. Once a
property is set, later the same property can not overwrite the previous one.
This process provides a good leverage of presetting all properties in one
location, and overwriting only the needed properties.................
Read answer
Latest answer: We can not modify the properties in ant. The
properties in ant are immutable in nature.................
Read answer
Latest answer: There is no need to use Runtime in ant. Because
ant has Runtime counterpart by name ExecTask. ExecTask is in the package
org.apache.tools.ant.taskdefs..............
Read answer
Latest answer: The following is an example to run a java
application in using ant:
<target name=”run” depends=”some.target”,some.other.target”>
<java classname=”${run.class}” fork=”yes”>
<classpath>.....................
Read
answer
Latest answer: Ant script can be debugged in the following
ways: By echoing at the place to debug. The problem is easily known. This is
similar to printf () function in C and System.out.println() in Java............
Read answer
Latest answer: Define the user defined custom script and use
taskdef to define in the custom script..............
Read answer
Latest answer: 1. Copy the ant-contrib.jar to the directory
ant*/lib. Copy ant-contrib.jar to your ant*/lib directory.
2. Append the following code snippet to avail all the ant-contrib
tasks...............
Read answer
Latest answer: The org.apache.tools.ant.input.InputHandler
interface is used to implement the user input. To perform the user input, the
application creates InputRequest object and this object will be passed to
InputHandler..................
Read
answer
Also read
Java methods are virtual by default. The virtual methods are the methods of
subclasses.................
A concrete class has concrete methods, i.e., with code and other functionality.
This class a may extend an abstract class or implements an
interface..................
SQL Exception is associated with a failure of a SQL statement. This exception
can be handled like an ordinary exception in a catch block..................
A task’s priority is an integer value. This value is used to identify the
relative order of execution with respect to other tasks..................
An event-listener interface allows describing the methods which must be
implemented by one of the event handler for a specific event..................
|