What does @ means in java?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 11

What does @ means in java??

28th Apr 2019, 2:54 AM
Nasir❤
Nasir❤ - avatar
3 Answers
+ 4
Are they annotations used for Javadoc documentation?
29th Apr 2019, 1:09 AM
Sonic
Sonic - avatar
+ 2
Sonic yes they can be used in Javadoc annotations to say the thing you are documenting e.g @param for a parameter but a non-commented Java line of code with an @ - i.e. not in Javadocs - are annotations: very useful to tie extra code/meaning to a field or class. e.g. In a JUnit test class, the annotation @Before on a method is to reflect that this method needs to be run before any tests are executed - this saves me having to manually put such method calls in test methods I haven’t looked at the links Khalid Saifullah Fuad has shared but I’m sure they will cover examples too
29th Apr 2019, 5:52 AM
Jenine