Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

importing packages

843810Aug 5 2005 — edited Aug 8 2005
hey, i'm new to java, so bear with me here. ^.^

I'm working on a summer assignment for school. I've downloaded all of the files i've been told to download, and saved them in the files directed by my teacher. I've copied over the codes she's given us into JCreator, and I've posted the code below:

import chn.util.*;

public class StudentInfoDriver
{
public static void main(String args[])
{
StudentInfo student1 = new StudentInfo();

System.out.println("Student #1 Info \n");
System.out.println("Student's Name: " + student1.getName());
System.out.println("Student's Age: " + student1.getAge());
System.out.println("Student's Hobby: " + student1.getHobby() + "\n" );


StudentInfo student2 = new StudentInfo();
ConsoleIO keyboard = new ConsoleIO();

System.out.println("Enter your name");
String name = keyboard.readLine();
student2.setName(name);

System.out.println("Enter your age");
int age = keyboard.readInt();
student2.setAge(age);

System.out.println("Enter your hobby");
String hobby = keyboard.readLine();
student2.setHobby(hobby);

System.out.println("");
System.out.println("Student #2 Info \n");
System.out.println("Student's Name: " + student2.getName());
System.out.println("Student's Age: " + student2.getAge());
System.out.println("Student's Hobby: " + student2.getHobby() + "\n" );


System.out.println("Student #1 Info \n");
System.out.println("Student's Name: " + student1.getName());
System.out.println("Student's Age: " + student1.getAge());
System.out.println("Student's Hobby: " + student1.getHobby() + "\n");

}
}

and when i tried to compile it, i got this error:

C:\Program Files\Java\JCreator LE\MyProjects\StudentInfo\StudentInfoDriver.java:1: package chn.util does not exist
import chn.util.*;
^

i've checked, and i do have "chn.util" on my computer... how do i fix this?

thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2005
Added on Aug 5 2005
3 comments
352 views