Inner Class Instance Has Access To All Member of The Outer Class (Public, Private & Protected)
Inner Class Instance Has Access To All Member of The Outer Class (Public, Private & Protected)
Inner class
instance has special relationship with Outer class.
This special relationship gives inner class access to
member of outer class as if they are the part of outer
class.
Inner class instance has access to all
member of the outer class(Public, Private &
Protected)
Syntax for creating Inner Class
1 //outer class
2 class OuterClass {
3 //inner class
4 class InnerClass {
5}
6}
1
2
3
4
5
6
//outer class
class OuterClass {
//inner class
class InnerClass {
}
}
1 outer.class
2 inner$outer.class
WithinOuter Class
Outer class can create instance of the inner class in the same way
as normal class member.
class OuterClass {
private int i = 9;
Description
/* text */
// text
/** documentation */
Javadoc organization
The HTML output generated byjavadocis organized like java
source is:
at the top level, as a group of several packages (with an
overview summary),
within a group, as individual packages (each with a
package summary),
within a package, as classes and interfaces (each with a
class or interface doc comment), and
within a class or interface, as fields (each with a
field doc comment), and constructors and methods (each with a
constructor or method doc comment).
/**
* The HelloWorld program implements an application that
* simply displays "Hello World!" to the standard output.
*
* @author Zara Ali
* @version 1.0
* @since 2014-03-31
*/ public class HelloWorld
{
public static void main(String[] args)
{
/* Prints Hello, World! on standard output.
System.out.println("Hello World!");
}
}
/**
* <h1>Hello, World!</h1>
* The HelloWorld program implements an application that
* simply displays "Hello World!" to the standard output.
* <p>
* Giving proper comments in your program makes it more
* user friendly and it is assumed as a high quality code.
*
*
* @author Zara Ali
* @version 1.0
* @since 2014-03-31
*/
public class HelloWorld
{
public static void main(String[] args) {
/* Prints Hello, World! on standard output.
System.out.println("Hello World!");
}
}
{@docRoot}
@deprecated
@exception
{@inheritDoc}
{@link}
{@linkplain}
Description
Adds theauthorof a class.
Displays text in code font
without interpreting the text
as HTML markup or nested
javadoc tags.
Represents the relative path
to the generated document's
root directory from any
generated page
Adds a comment indicating
that this API should no longer
be used.
Adds aThrowssubheading to
the generated documentation,
with the class-name and
description text.
Inherits a comment from
thenearestinheritable class
or implementable interface
Insertsan in-line link with
visible text label that points to
the documentation for the
specified package, class or
member name of a referenced
class. T
Identical to {@link}, except
the link's label isdisplayedin
Syntax
@author name-text
{@code text}
{@docRoot}
@deprecated deprecated-text
@exception class-name
description
{@linkplain
package.class#member label}