Java syntax: Difference between revisions

Content deleted Content added
m Type import declaration: added package - etc. Check this please.
Line 260:
====Type import declaration====
 
A type import declaration allows a named type to be referred to by a simple name rather than the full name includingthat includes the package. Import declarations can be ''single type import declarations'' or ''import-on-demand declarations''. Import declarations must be placed at the top of a code file after the package declaration.
 
<source lang=Java5>
package myPackage;
 
import java.util.Random; // Single type declaration
 
Line 275 ⟶ 277:
</source>
 
Import-on-demand declarations alloware to import all the types of the package,mentioned in the casecode. ofA "type import," orimports members, inall the casetypes of the package. A "static import," asimports theymembers are mentioned inof the codepackage.
 
<source lang=Java5>