• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

what is "int.class"?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,everyone
what is "int.class"and how can i use it?


Thanks
 
Ranch Hand
Posts: 904
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your explanation
 
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic