Java - What is the output: String type annotation value?

Question

What is the output of the following code?

@interface Name {
  String first(); 
  String last(); 
}

@Name(first=new String("A"), last="B") 
public class Main {
  
}


Click to view the answer

//Compile time error
@Name(first=new String("A"), last="B")

Note

The expression new String("John") is not a compile-time constant expression: