Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Java General Java Package and class declarations Tutorial

A package represents a group of classes.

Tutorial Details:

Java Package and class declarations

A package represents a group of classes. A package statement should be the first valid statement in the source file. If there is no package statement, the classes in the source file belong to the default unnamed package, or else they belong to the named package. Only one package statement is allowed in a source file.

In a source file, there can be only one public class, and the name of the file should match that of the class. An import statement allows you to use a class directly instead of referring to it using its fully qualified name. Import statements must come after any package statement and before the class declarations, as shown below:

package com.abc; // package statement
import java.net.*; // wild card import (imports all classes in the package)
import java.util.Vector; // class import (only the given class is imported)
Nested class declarations

A nested class or inner class is a class defined inside another class. Nested classes can be non-static, method-local, anonymous, or static.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Java General Java Package and class declarations Tutorial

View Tutorial:
Java General Java Package and class declarations Tutorial

Related Tutorials:

Static class declarations
Static class declarations
 
Printing in Java, Part 4 - JavaWorld February 2001
Printing in Java, Part 4 - JavaWorld February 2001
 
Reveal the magic behind subtype polymorphism - JavaWorld April 2001
Reveal the magic behind subtype polymorphism - JavaWorld April 2001
 
Language improvements and models make great Java - JavaWorld
Language improvements and models make great Java - JavaWorld
 
Create a quick-and-dirty XML parser
Create a quick-and-dirty XML parser
 
Java Tip 130: Do you know your data size?
Java Tip 130: Do you know your data size?
 
Best tools for mobile application development
Best tools for mobile application development
 
Excellent tutorial on Struts and Tiles
Excellent tutorial on Struts and Tiles This tutorial assumes knowledge of Java, JDBC, Servlets, J2EE (with regards to Web applications) and JSP Struts in a holistic manner, minus the beads and crystals. The Tiles framework makes creating reusable pages
 
The JDBC RowSet Implementations Tutorial
In "The JDBC RowSet Implementations Tutorial," you will look at how to use the standard JDBC RowSet implementations specified in JSR-114.
 
Commons Transaction
Commons Transaction aims at providing lightweight, standardized, well tested and efficient implementations of utility classes commonly used in transactional Java programming. Initially there are implementations for multi level locks,
 
Servlet Essentials
This document explains the concepts of Java Servlets and provides a step-by-step tutorial for writing HTTP Servlets with complete source code for the example Servlets. The tutorial and the other chapters cover all facets of Servlet programming from a ...
 
JSP Tutorial
This Tutorial is for beginners in the Java Server Pages Technology
 
JavaServer Pages Technology - Documentation
Sun's tutorial for Java Server Pages that provide a good introduction to design web pages with JSP.
 
Getting Started With the Mobile 3D Graphics API for J2ME
This tutorial introduces the Mobile 3D Graphics API for J2ME, JSR 184. The article presents an overview, potential application areas, the differences between JSR 184 and two related APIs, the classes in the new optional package, the programming model, the
 
Understanding Network Class Loaders Class loaders
One of the cornerstones of Java dynamics, determine when and how classes can be added to a running Java environment.
 
Introduction To Enterprise Java Bean(EJB). WebLogic 6.0 Tutorial.
Introduction To Enterprise Java Bean(EJB). WebLogic 6.0 Tutorial. Welcome to EJB Section (Learn to Develop World Class Applications with Enterprise Java Beans) (Online WebLogic 6.0 Tutorial) Introduction To Enterprise Java Bean(EJB) Enterprise
 
Introduction to JSP Declaratives Declarations
Introduction to JSP Declaratives Declarations INTRODUCTION TO JSP DECLARATIVES Syntax of JSP Declaratives are: <%! //java codes %> JSP Declaratives begins with <%! and ends %> with .We can embed any amount of java code in the JSP Declaratives.
 
JSP FUNDAMENTALS
JSP FUNDAMENTALS JSP FUNDAMENTALS By: Hrishikesh Deshpande Introduction : JSP termed as Java Server Pages is a technology introduced by Sun Microsystems Inc. to develop the web application in more efficient way than Servlets. It has got many
 
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
 
JPackIt JPackIt is a Java application for packaging a Java project into single executable package
Java Project in single jar, class or exe containing all java application resources and referenced libraries.
 
Site navigation
 

 

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

Copyright © 2006. All rights reserved.