Java

How do I know how large is the byte code of my program? I wrote a calculator program using java AWT.
shahrine99Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mayank SAssociate Director - Product EngineeringCommented:
You can see the file size in your OS. For example if it is Windows, you can see the file size in Windows Explorer.
0
Mayank SAssociate Director - Product EngineeringCommented:
You can also write another program to do the same. You can load the file class information into a java.io.File object and use the length () method. See this example:

http://www.exampledepot.com/egs/java.io/GetLength.html?l=rel
0
shahrine99Author Commented:
so u mean, where I saved my program, I put my mouse over the file and I see a blog and it said size: 9.05 KB ..is dat how big my program is?
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Mayank SAssociate Director - Product EngineeringCommented:
Yes that is how big your program is (assuming you pointed it on the .class file and not the .java file since you asked about the size of the byte code).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shahrine99Author Commented:
awesome...i learned something =)
0
Mayank SAssociate Director - Product EngineeringCommented:
:-)
0
shahrine99Author Commented:
hey another question...on the main.java file..i see the size is 8,964. Is dat in KB, MB or wat?
0
Mayank SAssociate Director - Product EngineeringCommented:
That is KB
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.