Problem With JAVA

Discussion in 'Computer Science & Culture' started by SonOfBOB, Aug 21, 2003.

Thread Status:
Not open for further replies.
  1. SonOfBOB Registered Member

    Messages:
    11
    I justarted leaning how to program in java and so when I try to run a file I have created it gives me a single error which stats something about classdefnotfound.
    can someone please help
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. AntonK Technomage Registered Senior Member

    Messages:
    1,083
    Java is a very simple language to learn. Here is a sample program:
    Code:
    class HelloWorldApp {
        public static void main(String[] args) {
            System.out.println("Hello World!"); //Display the string.
        }
    }
    
    We save it in a fille called HelloWorldApp.java
    The filename and the class name must be the same. Once we save it we compile the code to bytecode like this:
    Code:
    javac HelloWorldApp.java
    
    Then we run it like this:
    Code:
    java HelloWorldApp
    
    Thats all there is to it.

    -AntonK
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. testify Look, a puppy! Registered Senior Member

    Messages:
    508
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. CompiledMonkey The Lurker Registered Senior Member

    Messages:
    96
    AntonK gave you a great tutorial on getting your first app going. If you need help, post your code and how you're trying to compile and run it. That will help us in helping you.

    Please Register or Log in to view the hidden image!

     
  8. SonOfBOB Registered Member

    Messages:
    11
    thanx guys

    thank you very much and I will probably come back here when I have more problems
     
Thread Status:
Not open for further replies.

Share This Page