This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is "int.class"?

 
Jack Horner
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,everyone
what is "int.class"and how can i use it?


Thanks
 
Svend Rost
Ranch Hand
Posts: 904
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. Int.java. 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 Int.java

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

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
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your explanation
 
Mike Gershman
Ranch Hand
Posts: 1272
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic