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?
 
Mayank SConnect With a Mentor Associate 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
 
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
 
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
All Courses

From novice to tech pro — start learning today.