Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

import statement

 
pasaris sirasap
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i make my group of classes be imported to my program ? whats the procedure for that
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your classes are not in a named package, just put them in the same directory that has the class named in the javac command or a directory named in your classpath.

If packages are involved, the first identifier in the package name should be a subdirectory either in the same directory as the file named in your javac command or a directory in your classpath. If there are other identifiers in the package name, create subdirectories downward from the first subdirectory. Store your class or interface source file in the lowest of these subdirectories.

You can refer to members of packages either by putting the full package name in front of the class or interface name every time you use it or with an import statement. References within the same package can just use the simple name.

You can look up the format and placement of package and import statements.

[ February 14, 2005: Message edited by: Mike Gershman ]
[ February 14, 2005: Message edited by: Mike Gershman ]
 
Yosi Hendarsjah
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pasaris,
I don't know how I got the feeling that you're not using your real name.

yosi isoy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic