Solved

Java

Posted on 2007-03-18
8
181 Views
Last Modified: 2010-03-31
How do I know how large is the byte code of my program? I wrote a calculator program using java AWT.
0
Comment
Question by:shahrine99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 30

Expert Comment

by:Mayank S
ID: 18746157
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 18746159
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
 

Author Comment

by:shahrine99
ID: 18746171
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Accepted Solution

by:
Mayank S earned 500 total points
ID: 18746196
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
 

Author Comment

by:shahrine99
ID: 18746198
awesome...i learned something =)
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18746201
:-)
0
 

Author Comment

by:shahrine99
ID: 18746230
hey another question...on the main.java file..i see the size is 8,964. Is dat in KB, MB or wat?
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18746240
That is KB
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question