?
Solved

Java Question

Posted on 2003-03-13
5
Medium Priority
?
274 Views
Last Modified: 2010-03-31
Hi, I am trying to run a java program in a program called JCreator. However I go to compile it and it has 2 errors. I took this code right out of a book so i don't see why it doesnt work. Here is the source code. Could someone please tell me whats the matter I dont know if its my Java or the JCreator.

class HellowWorld {
     public static void main (string args[]) {
          System.out.printIn ("hello Nick");
     }
}
0
Comment
Question by:neocytrix
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 3

Expert Comment

by:allahabad
ID: 8133185
class HellowWorld {
    public static void main (String args[]) {
         System.out.println ("hello Nick");
    }
}
0
 
LVL 3

Expert Comment

by:allahabad
ID: 8133197
-->string
has to be String
-->printIn
has to be println
0
 

Author Comment

by:neocytrix
ID: 8133200
the Dos prompt is coming up with this,
 Exception in thread "main" Java.lang.NoClassDefFoundError: myclass/java
0
 
LVL 9

Accepted Solution

by:
yongsing earned 200 total points
ID: 8133236
What you need to do:

(1) Add the "public" keyword to the class declaration.
(2) Change "string" to "String";
(3) Name the file as "HelloWorld.java"
(4) In JCreator, select the "Build" menu item, and click "Compile File".
(5) Select "Build" menu item, and click "Execute File" to run the program.

public class HellowWorld {
  public static void main (String args[]) {
    System.out.println ("hello Nick");
  }
}
0
 
LVL 3

Expert Comment

by:allahabad
ID: 8133238
Save it as HellowWorld.java.
Go to directory where you have this file.
Compile it as javac HellowWorld.java.
Run it as java HellowWorld.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month7 days, 20 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question