I am a Java newbie,using JBuilder6
While I can create some simple Java prograams myself,I cannot run Java from other sources. For example:
//from "Thinking in Java",page #120
package hellodate;
import java.util.*;
public class HelloDate {
public static void main(String[] args) {
System.out.println("Hello, it's "
System.out.println(new Date());
}
}
//gives the following error
//"Untitled1.java": Error #: 475 : class HelloDate is public; must be declared in a file named HelloDate.java at line 7, column 8
I obviously don't understandsomething about the structure.
Can you advise me?
In other samples, the code
System.out.println("some string"
ran w/o error but no output appeared on the screen.
While I can create some simple Java prograams myself,I cannot run Java from other sources. For example:
//from "Thinking in Java",page #120
package hellodate;
import java.util.*;
public class HelloDate {
public static void main(String[] args) {
System.out.println("Hello, it's "
System.out.println(new Date());
}
}
//gives the following error
//"Untitled1.java": Error #: 475 : class HelloDate is public; must be declared in a file named HelloDate.java at line 7, column 8
I obviously don't understandsomething about the structure.
Can you advise me?
In other samples, the code
System.out.println("some string"
ran w/o error but no output appeared on the screen.