I am trying to pass the string firstName from a Servlet
called SampleServet. I am running this on eclipse and it
tells me that "the value for annotation attribute must be a
constant expression. I don't understand why it is giving me
this error.

@PersonAnnotation(name = SampleServlet.firstName)
public class AnnotationClass{


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More J2SE Code Interview Questions

In java, why do we set thread priority, when we know that there is no guarantee by which a thread should be execute?

0 Answers   Google, Microsoft,


Why the program getting error if we don't use String args[] in main(), even in the case of not getting any arguments from command line?

1 Answers  


Write a java program to display multiplication table in a Frame.

1 Answers  


How to create Date method to set the date in Ms Access

0 Answers  


write a java program to create a Frame with three scrolls, change the back ground color of the frame using functions with values of scrolls.

0 Answers  






write a program in java to find the moving average of all prime numbers between 2 and 100.

0 Answers  


Is it possible to define marker interface in java.If possible then how to define user defined marker interface?

1 Answers   Tech Mahindra,


Write a program to convert a decimal number to binary form?

1 Answers   Oracle,


Design a program using one-dimensional array that determines the highest value among the eight input values from a user. Display the difference of each value from the highest to the lowest.

1 Answers   RoboSoft,


How Can I Trace A Java Program . Please Give Me Step by Step Process

1 Answers   IBM,


is public static void main() work in java?is "String arg[]" needed as argument?

4 Answers   Tech Mahindra,


I am trying to pass the string firstName from a Servlet called SampleServet. I am running this on eclipse and it tells me that "the value for annotation attribute must be a constant expression. I don't understand why it is giving me this error. @PersonAnnotation(name = SampleServlet.firstName) public class AnnotationClass{

0 Answers  


Categories