954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to run/view .class file in java?

hello everyone, is there any tool class or utilities class in java class library that can run/view .class file?. for example if i click a jbutton i can view a .class file.. Please help. thanks.

viber101
Light Poster
25 posts since Jul 2008
Reputation Points: 9
Solved Threads: 0
 

You can view a .class file like any other file: By opening it. Use whatever program you want to open it. But don't expect to see anything. Here is a sample of what a .class file looks like when I used PSPad:

CAFE BABE 0000 0031 0112 0A00 4E00 B409 002C 00B5 0900 2C00 B609 002C 00B7 0900 2C00 B809 002C 00B9 0900 2C00 BA09 002C 00BB 0900 2C00 BC09 002C 00BD 0A00 2C00 BE0A 002C 00BF 0A00 2C00 C00A 002C 00C1 0A00 2C00 C20A 002C 00C3 0A00 2C00 C40A 002C 00C5 0A00 2C00 C60A 002C 00C7 0700 C808 00C9 0A00 1500 CA08 00CB 0800 CC08 00CD 0800 CE0A 0027 00CF 0800 D00A 0027

As you can see it is binary code. Actually what you see is hex code (0,1,2,3,4,5,6,7,8,9,A,B, C,D,E,F) because this is how PSPad displays it, but in reality it is binary

javaAddict
Nearly a Senior Poster
Team Colleague
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
 
hello everyone, is there any tool class or utilities class in java class library that can run/view .class file?. for example if i click a jbutton i can view a .class file.. Please help. thanks.

read your classnotes again, and check what a .class file actually is.
it's just the compiled version of your .java file

if you know how to read, edit and run your .java files, you know all you need to know about that.

in order to run: java MyApplication.java

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You