Click here to Skip to main content
15,799,257 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I recently read an article speaking about the Java annotations, and on this latter comes the @Generated annotation. They say that it is used for automatically generated code.

Could someone explain me that in further with a little example ?

Thank You.

1 solution

As per documentation, The Generated annoation is used to mark source code that has been generated. It can also be used to differentiate user written code from generated code in a single file.

Details here: Annotation Type Generated[^]
Share this answer
Schehaider_Aymen 7-May-12 10:03am    
Code has been generated automatically via the framework or based on an external user class ?

public class MyClass{

public void developerCode(){

value = "ClassNameThatGeneratedThisCode",
comments = "This is Tool Generated Code",
date = "5 June 2007"
public void toolGeneratedCode(){


What this code really do/generate ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900