The separator @ (at sign) is used to denote an annotation:
@Override
int someMethod(String s){
//...
}
You have seen several examples of an annotation when we created a unit test in Chapter 4, Your First Java Project. There are several predefined annotations in the Java standard libraries (@Deprecated, @Override, and @FunctionalInterface, to name a few). We are going to use one of them (@FunctionalInterface) in Chapter 17, Lambda Expressions and Functional Programming.
The annotations are metadata. They describe classes, fields, and methods, but they themselves are not executed. The Java compiler and JVM read them and treat the described class, field, or method in a certain way depending on the annotation. For example, in Chapter 4, Your First Java Project, you saw how we used the @Test annotation. Adding it in front of a public non-static method tells JVM that it is a test method that has to be run. So, if you execute this class, the JVM will run only this method.
Or, if you use the @Override annotation in front of a method, the compiler will check to see whether this method actually overrides a method in a parent class or not. If the matching signature of a non-private non-static class is not found in any of the class parents, the compiler will raise an error.
It is also possible to create new custom annotations (JUnit framework does exactly that), but this topic is outside the scope of this book.