View Single Post
  #4   (View Single Post)  
Old 8th April 2009
dk_netsvil dk_netsvil is offline
Real Name: Devon
Fdisk Soldier
 
Join Date: May 2008
Location: New York
Posts: 75
Default

I think there are a couple issues going on here:

First, when you declare this class you might want to retrieve data stored in the class from an accessor method. So you would define your class, your class-level attributes, and some methods and you would define a class to test this that would call a method to retrieve your string. Otherwise use something like this:

public class HelloWorld
{
public static void main( String[] args )
{
String s = "Hello World!";
System.out.println( s );
}
}

Second, I would agree that your font might be screwed up. I'm not sure which IDE you're using, but you should be able to change it to support your character map.

However, be aware that a class is not something that should be run standalone in most implementations - if I were you I'd define a class like this:

public class HelloWorld
{
public String getHello()
{
String s = "Hello World!";
return s;
}
}

and define a class to evaluate this class like this:

public class TestHelloWorld
{
public static void main( String[] args )
{
HelloWorld hw = new HelloWorld();
System.out.println( hw.getHello() );
}

}

That's not 100% accurate, but it should give you enough to start from. I'd also recommend checking out the Java Docs in your IDE - most IDEs have decent documentation built in.

Last edited by dk_netsvil; 8th April 2009 at 07:56 PM.
Reply With Quote