• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Comments in java

 
Greenhorn
Posts: 12
Hibernate Postgres Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After compiling a java source code.We get a class file containing no comments.
Consider a case ,where we need a user of a class file to use that comments.

So where that comments goes ?and is there any way to retrieve it back ?

Note :This is not my mind question,our teacher asked us.Somebody deleted my topic,so I'm reposting it.

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The compiler simply ignores the comments in your source code. If you have only the class file and not the original source file, then there is no way to get the comments back.
 
Vinayak Sakhare
Greenhorn
Posts: 12
Hibernate Postgres Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hie Jesper,

but if teacher ask this.then I think ther must be some way.
 
Ranch Hand
Posts: 1032
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, what Jesper said is absolutely correct. I think you must have misunderstood your teacher (maybe he is talking about use of Javadoc?)
 
Vinayak Sakhare
Greenhorn
Posts: 12
Hibernate Postgres Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok...ok...Coming Sunday I have JAVA class. I'll ask d answer...
 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What your teacher probably asked is, is there a way you can still have a copy of the comments in code after compilation. The simple answer is "YES".

And how ? Well, you need to code your java programs with "javadoc" compatible comments. Once this is done, you can autogenerate javadoc html pages out of this which organises your code comments in a standardized javadoc format, which could be of use to the future users of your class files.

Dawn.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic