Meaning Of annatations and use 1 Answer(s) 4 years and 6 months ago
Posted in : Java Interview Questions
View Answers
December 1, 2008 at 12:31 AM
Hi friend,
Annotation is the way of associating the program elements with the meta tags so that the compiler can extract program behavior to support the annotated elements to generate interdependent code when necessary.
It provide data about a program that is not part of the program itself. They have no direct effect on the operation of the code they annotate.
Annotations have a number of uses, among them:
* Information for the compiler ? Annotations can be used by the compiler to detect errors or suppress warnings.
* Compiler-time and deployment-time processing ? Software tools can process annotation information to generate code, XML files, and so forth.
* Runtime processing ? Some annotations are available to be examined at runtime.
Annotations can be applied to a program's declarations of classes, fields, methods, and other program elements.
Defining an annotation (Annotation type)
public @interface Example { String showSomething(); }
Annotating the code (Annotation)
Example (showSomething="Hi! How r you") public void anymethod() { .... }
Annotation Types: Three types of annotations types are there in java.
* Marker: Like the marker interface, marker annotations does not contain any elements except the name itself. The example given below clarifies the concept of marker interface.
Example:
public @interface Example{
}
Usage:
@Example public void anymethod() { ------------ }
* Single-value: This type of elements provide only single value. It means that these can be represented with the data and value pair or we can use the shortcut syntax (just by using the value only within the parenthesis).
Example:
public @interface Example{
String showSomething();
}
Usage:
@Example ("Hi ! How r you") public void anymethod(){
--------
}
* Multi-value or Full-value: These types of annotations can have multiple data members. Therefore use full value annotations to pass the values to all the data members.
Example:
public @interface Example{
String showSomething(); int num; String name;
}
Usage:
@Example (showSomething = "Hi! How r you", num=5, name="zulfiqar" ) public void anymethod{
// code here
}
For read more information on Annotations visit to :
Meaning Of annatations and use - Java Interview Questions Meaning Of annatations and use Hi all
use of Annatations and exat meaning of annatations
we create our own annatations give an Example... or we can use the
shortcut syntax (just by using the value only within
Tattoo Ideas for Girls with Meaning
Tattoo Ideas for Girls with Meaning: Tattoos with deep meaning
While many tattoos are just creative work of art, some text tattoos have a
deeper meaning. There are many tattoo ideas for girls with meaning. To show pain
and distress
Meaning of invoice Meaning of invoice hello,
What is the meaning of invoice?
hii,
Invoice is a statement which contains the following listed things.
Invoice Number
Invoice date
Name and address of the person
Name and address
what is the meaning this coad?
what is the meaning this coad? what is the meaning this coad?
Example Form example form = (Example Form) form
what is the meaning of this or explain this
what is the meaning of this or explain this List<Object[]> list=query.list();
Hi Friend,
It will return the query values in the form of list.
For more information, visit the following link:
Hibernate
MEANING OF THe CODE IN BOLD LETTERS MEANING OF THe CODE IN BOLD LETTERS public static void main(sting args[])
{
shape s[] = {new circle(),new rectangle()};
}
//HERE SHAPE RECTANGLE AND CIRCLE ARE THREE CLASSES WHICH ARE DEFINED EARLIER IN THE PROGRAM
Keyword - this
Keyword - this
A keyword is a word having a particular meaning to the programming
language... variables same. Now to avoid the
confliction between them we use this keyword
Introduction
be differ in meaning based on different use of uppercase and lowercase
letters. Sometime words can differ in meaning with the same words while starts
with capital
Green UML
Green UML
green
is a LIVE round-tripping editor, meaning that it supports both software
engineering and reverse engineering. You can use green to create a UML
Why we should use string args[] in main method in java?
Why we should use string args[] in main method in java? we use only string in the main method not any other one.. specify the reason...
and tell me each and every meaning of public static void main(String args[])...
 
Images - ImageIcon
, both to
use on buttons and labels, and to draw in a graphics panel.
The supported... is not critical)
This simple approach loads the image "synchronously", meaning....
Overlap (use only for performance problems)
Start loading each image in its
use of annotation. use of annotation. for concurrency which annotation can be used
use is of 2 use is of 2 why we use 2 in "Integer.parseInt(str,2);" for binary to decimal conversion..??
ya i got it... because binary contain only two o and 1...so here use 2...same as octal has 8
Use of jQuery Use of jQuery What is the use of jQuery?
Hi,
jQuery is JavaScript Ajax library. Developer is using it to create rich internet applications.
Read at jQuery Tutorial.
Thanks
JavaScript Variables
and this should be
start with either a letter or underscore.
We can use var
use of jquery use of jquery what is a jquery?
what is the evalution of jquery?
Hello Friend,
Please visit the following link:
JQuery Tutorials
Thanks
use of splitpane use of splitpane using JSplitPane split pane in three part. 1st in textField 2nd label and 3rd description.
in textField we enter the primary key in textField than it show its all two part as label(image) and description of user
SQL Use
SQL Use
SQL Use...
The Tutorial illustrate an example from 'SQL Use'. To understand
and grasp the 'SQL Use' we create a database 'komal' using create
database keyword
Use of FTPClient
In this section we will discuss about use of FTPClient class with example
Use if in velocity Use if in velocity
This example shows you how
to use if statement in velocity. Description of methods used in the example
given below....
1:- Initialize velocity run time
use of ActionMapping in validate() use of ActionMapping in validate() why do we pass actionmapping in validate(ActionMapping mapping,HttpServletRequest) even we don't use actionmapping in that method
What is the use of Bluetooth technology
What is the use of Bluetooth technology What is the use of Bluetooth technology?
Bluetooth technology is used for Wireless communication between equipment's
Use of Selectors
Uses of jQuery Selectors
Uses of jQuery Selectors
In this section we are discussing the use of jQuery selectors.
For using JQuery library most effectively
Use of CASCADE CONSTRAINTS Use of CASCADE CONSTRAINTS hii,
What is the use of CASCADE CONSTRAINTS?
hello,,
CASCADE CONSTRAINTS describes about the parent-child relationship between tables
Use javascript loops.. Use javascript loops.. Write a Javascript code to create a redirection script based on day of the week