Java
  Home arrow Java arrow Page 5 - Java Part 3: Primitive Types
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Java Part 3: Primitive Types
By: Chris Noack
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2001-12-03

    Table of Contents:
  • Java Part 3: Primitive Types
  • Primitive types in Java
  • Creating our first class
  • Our new class...explained
  • Compiling the Application
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Java Part 3: Primitive Types - Compiling the Application


    (Page 5 of 6 )

    Before we can compile our example, we will need to install a working Java environment. We will use the JDK (Java Development Kit), which is a free download.

    You can download the JDK for windows from http://java.sun.com/j2se/1.3/download-windows.html. The JDK is also available for Linux from http://java.sun.com/j2se/.

    After installing the software, run through the documentation to make sure that you've set it up correctly. The JDK should now be ready to use. If you are encountering any problems, refer back to the documentation provided with the JDK.

    To compile our example, we will need to save the example class that we have developed into a file named Number.java. When you create a class in a file, the filename has to match the name of the class. Save the file into a new directory, separate from your Java installation directory, c:\javacode, for example.

    Java code is compiled, meaning that your source code file, Number.java is converted into byte-code. The Java Virtual Machine then executes the byte-code. To compile our class file, we use the javac program, as follows:

    javac Number.java

    This will compile your .java file into a .class file, which is now ready to run. To run your application, simply type the following line at the DOS prompt or Unix command line:

    java Number

    Do not type Java Number.class. You don’t need to specify the .class extension! And there you have it, you have created your first Java application.

    More Java Articles
    More By Chris Noack


     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek