Solved

Java

Posted on 2007-03-18
8
166 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
  • 5
  • 3
8 Comments
 
LVL 30

Expert Comment

by:mayankeagle
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:mayankeagle
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
 
LVL 30

Accepted Solution

by:
mayankeagle 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

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

Expert Comment

by:mayankeagle
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:mayankeagle
ID: 18746240
That is KB
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

762 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now