Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Packages and Import

You define your Java program, and you name the packages you want to use from other libraries in an import statement.

Tutorial Details:

Package = directory. Java classes can be grouped together in packages. A package name is the same as the directory (folder) name which contains the .java files. You declare packages when you define your Java program, and you name the packages you want to use from other libraries in an import statement.

Package declaration
The first statement, other than comments, in a Java source file, must be the package declaration.

Following the optional package declaration, you can have import statements, which allow you to specify classes from other packages that can be referenced without qualifying them with their package.


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/language/10basics/import.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Packages and Import

View Tutorial:
Packages and Import

Related Tutorials:

Getting started with Java 2D - JavaWorld - July 1998
Getting started with Java 2D - JavaWorld - July 1998
 
Programming Java threads in the real world, Part 6 - JavaWorld - March 1999
Programming Java threads in the real world, Part 6 - JavaWorld - March 1999
 
How to avoid traps and correctly override methods from java.lang.Object - JavaWorld January 1999
How to avoid traps and correctly override methods from java.lang.Object - JavaWorld January 1999
 
Dynamic user interface is only skin deep - JavaWorld May 2000
Dynamic user interface is only skin deep - JavaWorld May 2000
 
Java security evolution and concepts, Part 3: Applet security - JavaWorld December 2000
Java security evolution and concepts, Part 3: Applet security - JavaWorld December 2000
 
Servlets in Apache Tomcat and BEA Systems' WebLogic Server - JavaWorld February 2001
Servlets in Apache Tomcat and BEA Systems' WebLogic Server - JavaWorld February 2001
 
Integrate EJBs with CORBA
Integrate EJBs with CORBA
 
Simply Singleton
Simply Singleton
 
Overcome J2SE 1.3-1.4 incompatibilities
Overcome J2SE 1.3-1.4 incompatibilities
 
Create client-side user interfaces in HTML, Part 2
Create client-side user interfaces in HTML, Part 2
 
classworlds
classworlds classworlds is a framework for container developers who require complex manipulation of Java\'s ClassLoaders. Java\'s native ClassLoader mechanims and classes can cause much headache and confusion for certain types of application developers.
 
To my mind, of few interest
To my mind, of few interest
 
Advanced Installer for Java
Advanced Installer for Java The quick, simple and powerful msi authoring tool Advanced Installer is a Windows Installer authoring tool which enables developers and system administrators to easily build reliable MSI packages that meet the latest Micr
 
Declarative Programming in Java
Declarative Programming in Java What makes EJB components special is the declarative programming model through which we can specify the services such as security, persistence, transaction etc., that the container should provide. An EJB only implements
 
What package names are defined in the J2ME environment?
A compendium of J2ME package names, neatly arranged by JSR and presented for your illumination.
 
Running Wine on the Sun Java Desktop System, Release 2
A BigAdmin reader describes how to install and use Wine, an open source implementation of the Windows API, on the Sun Java Desktop System, Release 2.
 
Introduction to JSP tags JSP Directives
Introduction to JSP tags JSP Directives INTRODUCTION TO JSP TAGS I n this lesson we will learn about the various tags available in JSP with suitable examples. In JSP tags can be devided into 4 different types. These are: Directives In the
 
We are providing Downloadable Version of K12LTSP Linux
We are providing Downloadable Version of K12LTSP Linux K12LTSP Linux Now Available Linux K12LTSP 4.2.0 CD's K12LTSP 4.2.0 is based on Fedora Core 3 and the LTSP terminal server packages. It's easy to install and configure. It's distributed under
 
Connecting to the Database Using JDBC and Pure Java driver
Connecting to the Database Using JDBC and Pure Java driver Connecting to the Database JDBC Driver In our search engine we are using MySQL database server and MM.MySQL Driver for connecting our application to the database. MM.MySQL Driver is
 
Getting Started With the PIM APIs
This article provides a code-intensive introductory tutorial to Personal information management (PIM) APIs, JSR 75.
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.