This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Explain How To Modify Properties In Ant? |
|
Answer» We can not MODIFY the PROPERTIES in ANT. The properties in ant are IMMUTABLE in NATURE. We can not modify the properties in ant. The properties in ant are immutable in nature. |
|
| 2. |
Explain How To Use Runtime In Ant? |
|
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. The TASK is CREATED by using the CODE in the customized ant Task. The code snippet is as FOLLOWS: ExecTask execTask = (ExecTask)project.createTask (“exec”); 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. The Task is created by using the code in the customized ant Task. The code snippet is as follows: ExecTask execTask = (ExecTask)project.createTask (“exec”); |
|
| 3. |
How Can I Use Ant To Run A Java Application? |
|
Answer» The following is an example to run a Java APPLICATION in using ANT: <target name=”run” DEPENDS=”some.target”,some.other.target”> The following is an example to run a Java application in using ANT: <target name=”run” depends=”some.target”,some.other.target”> |
|
| 4. |
Explain How To Debug My Ant Script? |
|
Answer» ANT script can be debugged in the following ways:
ANT script can be debugged in the following ways: |
|
| 5. |
Explain How To Use Ant-contrib Tasks? |
Answer»
<taskdef RESOURCE=”net/sf/antcontrib/antcontrib.properties”/> <taskdef resource=”net/sf/antcontrib/antcontrib.properties”/> |
|
| 6. |
Explain How To Make Ant User Interactive? |
|
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. The user input will be rejected if it is invalid. The InputHandler interface has exactly one METHOD, by name handleInput(InputRequest REQUEST). This method throws org.apache.tools.ant.BuildException, if the input is invalid. 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. The user input will be rejected if it is invalid. The InputHandler interface has exactly one method, by name handleInput(InputRequest request). This method throws org.apache.tools.ant.BuildException, if the input is invalid. |
|
| 7. |
Explain How To Test Classes For Junit Using Ant Script? |
|
Answer» <target name="test" depends="-copytestresources, compile"> <target name="test" depends="-copytestresources, compile"> |
|
| 8. |
Explain How To Compile Using Ant Script? |
|
Answer» <target name="compile" depends="-init"> <target name="compile" depends="-init"> |
|
| 9. |
Explain How To Use Pmd Validation In Ant Script? |
|
Answer» <TARGET NAME="validate" depends="-init"> <target name="validate" depends="-init"> |
|
| 10. |
Explain How To Use Clean In Ant Script? |
|
Answer» <TARGET name="clean" DEPENDS="-clean" /> <target name="clean" depends="-clean" /> |
|
| 11. |
Explain How To Import .jar Files? |
|
Answer» <path id="classpath.base"> <path id="classpath.base"> |
|
| 12. |
Explain Using Ant And Give An Small Example? |
|
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. For example, we want the application HelloWorld to be used with ant. The Java source files are in a subdirectory called Dirhelloworld, and the .class files are to put into a SUB directory called Helloworldclassfiles. 1. The build file by name build.xml is to be written. The script is as follows <project name=”HelloWorld” default=”compiler” basedir=”.”> 2. Now run the ant script to perform the compilation: C :\> ant and see the results in the extra files and directory created: c:\>dir Dirhelloworld All the .java files are in Dirhelloworld directory and all the corresponding .class are in Helloworldclassfiles directory. 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. For example, we want the application HelloWorld to be used with ant. The Java source files are in a subdirectory called Dirhelloworld, and the .class files are to put into a sub directory called Helloworldclassfiles. 1. The build file by name build.xml is to be written. The script is as follows <project name=”HelloWorld” default=”compiler” basedir=”.”> 2. Now run the ant script to perform the compilation: C :\> ant and see the results in the extra files and directory created: c:\>dir Dirhelloworld All the .java files are in Dirhelloworld directory and all the corresponding .class are in Helloworldclassfiles directory. |
|
| 13. |
Explain Ant Functionality? |
Answer»
|
|
| 14. |
How We Can Set Path Path And Classpath Into An Ant Build File? |
|
Answer» ANT does not NEED to SET CLASS PATH. Ant does not need to set class path. |
|
| 15. |
What Is Ivy? |
|
Answer» IVY is a popular dependency manager .IVY is basically focused on flexibility and simplicity. The latest version of Ivy is 2.1.0. Key features of the 2.1.0 RELEASE are
Ivy is a popular dependency manager .IVY is basically focused on flexibility and simplicity. The latest version of Ivy is 2.1.0. Key features of the 2.1.0 release are |
|
| 16. |
What Is Different Between Ant And Make? |
|
Answer» The most IMPORTANT difference between Ant and Make is that Ant USES XML to describe the build PROCESS and its dependencies, WHEREAS Make uses its Makefile format. By DEFAULT the ant XML file is named build.xml. The most important difference between Ant and Make is that Ant uses XML to describe the build process and its dependencies, whereas Make uses its Makefile format. By default the ant XML file is named build.xml. |
|
| 17. |
How You Can Prepare A Project In Ant? |
|
Answer» We can prepare a project by making a build.xml as a build FILE and using following tag. INSIDE this tag we have defined standard targets (such as build, CLEAN ETC), etc. We can prepare a project by making a build.xml as a build file and using following tag. Inside this tag we have defined standard targets (such as build, clean etc), etc. |
|
| 18. |
How We Can Create A Jar Using Ant? |
|
Answer» To make a jar of classes we NEED SET target as jar. In this target we need to make directory in which jar will stored. Then we need jar tag to make the jar .In this tag we have pass two attributes FIRST is name of destination directory and SECOND ONE is the name of base directory where our all class files are stored .We need a manifest to create a jar file. In manifest tag we have pass two attributes first is name of manifest file name and second is its value. To make a jar of classes we need set target as jar. In this target we need to make directory in which jar will stored. Then we need jar tag to make the jar .In this tag we have pass two attributes first is name of destination directory and second one is the name of base directory where our all class files are stored .We need a manifest to create a jar file. In manifest tag we have pass two attributes first is name of manifest file name and second is its value. |
|
| 19. |
What Is Dependency? How It Is Used Into Ant? What Is Its Use? |
|
Answer» DEPENDENCIES are do something when COMPLETE it. In ant we are using dependencies by using an attribute “depends” .In this attribute we have pass VALUES for which the target depends .This mean we first need to EXECUTE the target which is passed into this attribute. Dependencies are do something when complete it. In ant we are using dependencies by using an attribute “depends” .In this attribute we have pass values for which the target depends .This mean we first need to execute the target which is passed into this attribute. |
|
| 20. |
How You Can Explain Ant Property? |
|
Answer» A PROJECT can have a SET of PROPERTIES .A property has name and value .The name is case sensitive and Properties are immutable this mean once set property its will not change. Properties MAY be USED in the value of task attributes. A project can have a set of properties .A property has name and value .The name is case sensitive and Properties are immutable this mean once set property its will not change. Properties may be used in the value of task attributes. |
|
| 21. |
How Many Ways We Can Set Properties Into Build Ant File? |
|
Answer» There are six WAYS to set properties:
We can use the combinations of all above in our build files .But only one should be used at a time. There are six ways to set properties: We can use the combinations of all above in our build files .But only one should be used at a time. |
|
| 22. |
Why Ant Is A Great Build Tool? |
|
Answer» Ant is great build tool due to following REASON:
Ant is great build tool due to following reason: |
|
| 23. |
What Are The Capabilities Of Ant? |
|
Answer» 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. ANT PROVIDES the cross-PLATFORM deployment that can RUN on any platform. 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. ANT provides the cross-platform deployment that can run on any platform. |
|
| 24. |
Explain The Concepts Of Ant? |
|
Answer» Ant is a build tool that is java based. A build tool performs the following tasks: Open: Ant is an open source project available under the Apache license. Therefore, its source code can be downloaded and modified. ADDITIONALLY, Ant uses XML build files which make its development easy. Cross Platform: Use of XML along with Java makes Ant makes it the perfect solution for developing programs designed to run or be built across a range of different operating systems. Extensible: NEW tasks are used to extend the capabilities of the build process, while build listeners are used to help hook into the build process to add EXTRA error tracking functionality. INTEGRATION: As Ant is extensible and open, it can be integrated with any editor or development ENVIRONMENT easily. Ant is a build tool that is java based. A build tool performs the following tasks: Open: Ant is an open source project available under the Apache license. Therefore, its source code can be downloaded and modified. Additionally, Ant uses XML build files which make its development easy. Cross Platform: Use of XML along with Java makes Ant makes it the perfect solution for developing programs designed to run or be built across a range of different operating systems. Extensible: New tasks are used to extend the capabilities of the build process, while build listeners are used to help hook into the build process to add extra error tracking functionality. Integration: As Ant is extensible and open, it can be integrated with any editor or development environment easily. |
|
| 25. |
What Is A Build Tool? |
|
Answer» A built tool is software which is used to BUILD project, directory STRUCTURE, copy necessary files to that directory ,compile files ,CREATE jars, set path and class-path ,Build the documentation ,Validate the source code, deploy, debug, and RUN, clear the workspace. A built tool is software which is used to build project, directory structure, copy necessary files to that directory ,compile files ,create jars, set path and class-path ,Build the documentation ,Validate the source code, deploy, debug, and run, clear the workspace. |
|
| 26. |
Why Do You Call It Ant? |
|
Answer» The ant is ACRONYM of ”Another Neat Tool” according to JAMES DUNCAN Davidson. Ants are very small and can carry heavy weight. So as JOB of Apache ant. Its name is CALLED ANT. The ant is acronym of ”Another Neat Tool” according to James Duncan Davidson. Ants are very small and can carry heavy weight. So as Job of Apache ant. Its name is called ANT. |
|
| 27. |
What Is Ant? |
|
Answer» Ant is an open SOURCE code .It is Java-based build tool sponsored by Apache Software Foundation. It is a PROGRAM for putting all the pieces of a program TOGETHER. A simple definition might state that “Ant is a Java-based build tool from Apache Software Foundation”. Ant is kind of like MAKE. Ant is an open source code .It is Java-based build tool sponsored by Apache Software Foundation. It is a program for putting all the pieces of a program together. A simple definition might state that “Ant is a Java-based build tool from Apache Software Foundation”. Ant is kind of like Make. |
|