File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes what is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is "int.class"?" Watch "what is "int.class"?" New topic

what is "int.class"?

Jack Horner

Joined: Feb 22, 2005
Posts: 6
Hello ,everyone
what is "int.class"and how can i use it?

Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Hi Jack,

Do you mean the Integer class, or do you mean a file called "int.class"
that you have on your harddisk?

Im assuming you mean a file int.class in the following:

When you wan't to make a program/application in Java, you start
with a Java file, e.g. In this file you write Java code.
When you have written enough code, you have to "compile" the java file, which you do by the following command: >javac

That will create the file "int.class", assuming there arn't any errors
in the code of

Back to your question: a .class file is bytecode, and contains everything
the Java Virtuel Machine (JVM) needs to know about your java class.

For more information about the organization of the .class files I'd
recommend you to goto Javaworld and
search for "class file".

How do you use it?
Assuming the java class has the "static void main(String[] args)" method
you can execute with the following command: >java int

If the java class is more of a "helper" class, you can use the class in
your programs. Just as you use the normal Java classes like Vector, Math
and so on.

/Svend Rost
Jack Horner

Joined: Feb 22, 2005
Posts: 6
thanks for your explanation
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
There is a file int.class. The Integer wrapper class contains a constant, Integer.TYPE, which is a reference to this class file. It is used in reflection operations to represent the int primitives.

The following code will display the int class file for you.

Mike Gershman
SCJP 1.4, SCWCD in process
It is sorta covered in the JavaRanch Style Guide.
subject: what is "int.class"?
It's not a secret anymore!