• Post Reply Bookmark Topic Watch Topic
  • New Topic

compare *.java to *.class  RSS feed

 
Steve Taiwan
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear JavaRanchers.

I have A.java and A.class.
But how can I find out A.class is really compiled from the orginal A.java but not another A.java?
Please let me know if there is a solution for this.
Thanks in advance.
 
Marilyn de Queiroz
Sheriff
Posts: 9080
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javap A
will give you a clue.
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although javap will help, there's no definite answer since compiling removes commenting and other such details that may have been in the original code. I could make a infinite number of java files that compile to the same class file.
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, going a little bit further there's an infinite number of ways to compile the *same* java file especially if you include byte-code enhancements, although its not especially common.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!